Why Sitecore Image having Black border on Top and bottom? - sitecore

In my sublayout I'm trying to render image
HTML:
<sc:Image runat="server" ID="fldImage" Height="75px" Width="98px" />
CS code has following line to fill the image,
sitecoreImage.Field = SitecoreUtility.SITECORE_FIELD_LIST_IMAGE;
sitecoreImage.Item = sitecoreItem;
Image is getting Rendered with the black border on top and bottom.
while debug I see the Image URL like
/~/media/Images/image-thumb.jpg?as=1&h=75&la=en&w=98&hash=920D0F90FR9BE29A9DC4131BAF1C5CD6BEA96F3B
When try to request just the image with the following URL
http://domain/~/media/Images/image-thumb.jpg?as=1&h=75&la=en&w=98&hash=920D0F90FR9BE29A9DC4131BAF1C5CD6BEA96F3B
I see the image with the border.
But when I strip that hash=920D0F90FR9BE29A9DC4131BAF1C5CD6BEA96F3B from the url
http://domain/~/media/Images/image-thumb.jpg?as=1&h=75&la=en&w=98
I see the image is rendered without the black lines.
Why we are seeing the image with the black border in top and bottom?
Appreciate your help.

Your are requesting the image with a width and height which is probably not the original causing Sitecore to adjust the image to your request. As it will preserve the aspect ratio, it is possible that a background color is added to do so. The default background color used is black, that is why you are seeing this. You can change the color with the Media.DefaultImageBackgroundColor setting.
Once you remove the hash, Sitecore will no longer make the adjustments as the url has been tampered with. I assume that the width and height of your image is also different then (the actual size, not what you see on screen).

Related

Responsive srcset images by media query?

Have I misunderstood the img srcset tag if I say that I'd like to specify to the browser what image to show when the screen is max-size: 599px (mobile) and when it's above that?
<img
srcset="
small.jpg 600w,
big.jpg 2000w"
sizes="
(max-width: 599px) 600w,
2000w"
src="big.jpg" alt="Some text" />
This code doesn't behave at all how I'd expect it to. I'd like the browser to show the small image when it's a mobile screen, and show the large one for every other device resolution. Is there no way to do this simply? So confusing.
I've read articles on SitePoint, Smashing Mag, etc, and none of them explains it simply as above. They go into image widths, viewports, ratios, etc. All I need is to specify in a media-query screen resolution style which image to show at which resolution.
Many thanks.

Image overlap with alphachannel doesn't work on QT

I've put two label of the same dimension overlapped on my GUI. On the first, that is on the back there is one image set by the pixmap of the label. The second label has another image set by pixmap that is trasparent in some pixel. During design i can see the back image via the front image. When I execute the program, the trasparent pixel of the second image are transformed into white pixel, so i cant see the back image. I'm using QT 5.10. The image are in .png format.
I've resolved putting autoFillBackground on and i've changed the color of window in palette putting a transparent color

Facebook Open graph image does not scale correctly

I have added an open graph image to my site but in the news feed it is not scaled correctly. The image is clipped both at the top and at the bottom. The image itself is a png with the size of 1500x1500px.
Looking at my profile page where the image is placed to the left of the text it scales correctly.
I have specified the following meta tags: og:title, og:type, og:image, og:url, and og:description.
I use the ShareThis API for the actual share button (if that can have anything to do with this).
Has anyone had this problem as well?

Add text to a picture using photoshop

I want to know if exist templates to add text on photoshop like in the following pictures:
http://sphotos-e.ak.fbcdn.net/hphotos-ak-ash4/485070_566956359990277_263279122_n.jpg
https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash4/3263_403189956409783_609225582_n.jpg
Could you suggest some pages where I can study and try those effects ?
Thanks.
Step1: Find the fonts. Search on font sites for similiar fonts or try to cut out the font and upload it to http://www.whatfontis.com/ or http://www.myfonts.com/WhatTheFont/
Step2: just play around with blending options and stuff.
from what I can see it's these settings you want too look at:
"Notche Latina": Gradient overlay, white stroke and black dropshadow.
"photo recoblablabla": inner shadow and might be in overlay-mode or something
"Festival de la bira": once again, white stroke
First make a layer adjust the objcet on layer as per your requirement.
Add some effects from filter gallery if you required (or layer style).
Click on the text toolbar type your text (required text).Then to apply effects
right click on text layer and click on rasterize type.now you can add effects from the filter gallery to the text.(or Layer style eg-inner shadows,bevel and emboss).

Horizontal line in QTextEdit

I'm trying to put an horizontal line in a QTextDocument. I'm using HTML for the formatting. To draw the line I want, I naturally used the <hr /> tag. But the line is drawn gray and and I'd like to change its color to black.
The styles doesn't seem to apply on the hr element, so is there a simple workaround to have horizontal black line in my document?
Thanks.
Coming from HTML, <hr> does not really have the ability to be colored or formatted. IE did it with color, Mozilla with background-color etc.
So the best (both in HTML/css and QTextDocument) is to avoid <hr> and take instead any very small element, size it appropriately and give it a border and a background-color of same color as the border. E.g. a table row. I can dig up some code tomorrow or the day after - I have done this before so it must be somewhere.
As a workaround you can use some pixels height div with appropriate background-color.