HTML automatically rotating images on render - html

Can someone help me here. I have a PHP script which uploads an image and resizes it, and then an HTML page which displays the image. However, for some reason the HTML is rendering a rotated version of the image, although I can't for the life of me see why.
<div style="height:75px;width: 116px; background: url(http://viralsmods.com/pokeroulette/content/images/7.jpg);"></div>
Run the above snippet to see it in action. The image it is linked to is here: http://viralsmods.com/pokeroulette/content/images/7.jpg.
Any idea on why this could be?

The problem is related to EXIF (Exchangeable Image File Format) and the web browser
Basically, EXIF is a standard for holding file info such as which way an image should be rotated. Photos taken with (older) devices that do not use EXIF may not appear correctly in your web broswer.
The solution is to bring this file into photoshop, rotate as needed, save, then reupload for your site.

Related

Chrome Image EXIF Orientation Issue

I'm building a web app that shows pictures. Most of the pictures were taken by smart phones and have EXIF rotation information.
I'm exposing a url which return the image blob without modification.
I've notice that when I put this url in img tag Chrome does not respect the EXIF orientation data but when I put the url in chrome address bar it show a page with the image and then it does respect the EXIF orientation.
Sorry I can't share the image, I'll try to find another example that I can share.
Has anyone notice this problem?
The reason for this behavior is that Chrome auto-rotates pictures based on EXIF data only if they are displayed directly in a browser tab as the main document.
The relevant chromium issue that tracked this implementation is the following:
https://bugs.chromium.org/p/chromium/issues/detail?id=56845
In the future, Chrome (and other browsers) will allow developers to enable auto-rotation also for images displayed via img tags with the CSS image-rotation property:
https://bugs.chromium.org/p/chromium/issues/detail?id=158753
Update: as of Chrome 81 (moved to stable on 5/13/20), this behavior is supported in both img tags and backround-image tags. https://www.chromestatus.com/feature/6313474512650240

Images not showing when uploaded to server

I have a small five page website and have the images used across the website in the same folder, img. The website works fine offline and I upload everything with the same structure, however when I view the website on the server, certain images don't display for some reason.
For example, my logo and image slider photo's appear, but then images in the gallery are broken. They're all linked correctly, eg:
<img src="img/logo.png">
They're all name appropriately too, such as slider_1.png etc.
I'm not sure why some display fine whilst others don't, despite them all being in the same folder and being linked the same way in HTML.
Ok, the images are now working but for some reason the CSS isn't working correctly on my own server space, but works on my schools. I haven't played with any of the server settings etc.
Had the same problem and after reading half of Google saw that the new version of FileZilla changed the image extensions from .jpg to .JPG when uploaded to the we- problem solved.
You can change the code like this:
<img src="yourdomain.com/img/logo.png"=

Including a gif in html page

I have no idea why a simple gif image is not being loaded properly. In the html code I have the usual
<img src="/img/loading.gif" alt="Loading" title="Loading" />
and the file is in that folder. The weird thing is that if I place there /img/logo.png the image is loaded properly.
The filename is correct, I've even copied and pasted it renaming the original files.
PS tested on Firefox 12, Safari 6.0.2 Chrome 23.0.1271.95 (all for Mac)
It was probably a corrupt gif. Your code should work with some other gif. If you really want to get the corrupt gif to work, try opening it in an image editor program and then resave it as gif (or any other format).
Silly question, but what does your gif look like? Is it transparent, or white against a white background?
One possible way to diagnose the problem would be (in Chrome or Firefox), to press F12 to bring up the developer tools and look at your img element to see if the image has loaded in the DOM.
I think the problem was with the gif file, probably somehow broken. I got it from a random resources web site and downloaded from it.
I've tried with a new file got from http://www.ajaxload.info/ now with the code unchanged it works fine.
Edit: the "broken" gif file was working fine elsewhere in the system (e.g. quicklook).

image problem with dreamweaver

i'm trying to create a newsletter in a single html file, which will be loaded into outlook express and sent out as a mail.
i have like a few images embedded onto the html file but 2 of them cant be loaded for preview in design mode. there is no problem for the rest of the images. those images that cant be loaded has the grey color icon.
the directory for the images are the same. i have copied and pasted the absolute directory for the images that cant load and it doesnt work.
the images loads fine when executed from the html file that was uploaded to the webserver.
edit:
it only loads fine in firefox, and not ie!
i need to get the newsletter out tomorrow, any assistance here?
thanks in advance.
That sounds like a transparent PNG. If you are using an old version of IE, you are out of luck for the HTML email. Try using another type of image (8-bit PNG, PNG with no alpha values, JPEG, GIF). Open the image in your editor and save it as an 8-bit PNG, for example. An 8-bit PNG can only have binary transparency. You may have to redesign the page/email.

Images not displaying in WebKit based browsers

For some strange, bizarre reason, my images in my website just will not display on webkit based languages (such as safari and chrome).
This is the image tag
<img src="images/dukkah.jpg" class="imgleft"/>
Not only does it not display in the website, it wont display when accessed directly at http://kilkin.massiveatom.com/kilkin/images/dukkah.jpg
...Why?
Imagemagick reports that this particular image is saved in CMYK colorspace instead of the more standard RGB. Try converting it, it should be more compatible with the webkit rendering engine.
Imagemagick is available for download from http://www.imagemagick.org/script/index.php - it's available for windows and *NIX systems.
I have come across this problem a couple of times.
I think it is because of some problem in the file format.
Try importing the file in some image editor and saving it again. This should get rid of the problem.
I tried the url you gave in FireFox 3 and IE 6, IE 6 won't show it either, firefox works. My guess is that there is something wrong with the jpg file.
Are you JPEG's compressed in Jpeg 2000 Format? If so, there is a known bug:
https://bugs.webkit.org/show_bug.cgi?id=8754
"The image “http://kilkin.massiveatom.com/kilkin/images/dukkah.jpg” cannot be displayed, because it contains errors." and the image itself has some XML-fragment in it. So as others proposed: try to open with an editor and resave it.
It's as stated elsewere a bug in the image.
Irfanview is a very good viewer that will display any image (and other formats as well), is small and free and will also let you adjust, crop or rescale images very easily without heavy programs like photoshop.
I suggest download irfanview and the image, open the image in irfanview and hit CTRL+S and save it over itself. Then upload the image again. Any problem should be solved.
Your image file does not contain image data, it contains html text:
$ curl -s http://kilkin.massiveatom.com/kilkin/images/dukkah.jpg
<html><head></head><body><!-- vbe --></body></html>