Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ picture displaying wrong orientation

Posted by: Joe M Jul 8 2017, 01:00 PM

Very simple notepad hand written web page:

http://www.missilecommand.org/Space_Duel2/Space_Duel_2.html

I have it set up where is someone clicks on any picture, it brings up a higher resolution pic.

Problem is the 6th picture (entitled "Marquee back".). If you click on the picture, it displays it in a vertical orientation.

I've posted hundreds of pictures with this html code before and I've never encountered this before. When I open the picture on my PC (via Windows Explorer), it opens it as it should as horizontal. What is going on here? How do I correct this?

The dimensions in Windows Explorer show it as 2272 x 1704, indicating it is a horizontal picture. The html code is rotating it. Can't figure it out.

Thanks in advance.

Joe (joemagiera at ameritech dot net
joemagiera@ameritech.net

Posted by: Christian J Jul 8 2017, 03:26 PM

QUOTE(Joe M @ Jul 8 2017, 08:00 PM) *

When I open the picture on my PC (via Windows Explorer), it opens it as it should as horizontal.

In which device does it open vertically, a smartphone?

QUOTE
What is going on here? How do I correct this?

Nothing on the page is causing this, so I suspect your smartphone is rotating the image to make fit the screen better.

Posted by: pandy Jul 9 2017, 06:58 PM

I see it too, on my desktop. K-Mel, Firefox, Chrome. If I copy the image and paste it into an image editor it displays correctly in IrfanView, but not in my more advanced editor. Same if I save the image. OK in Irfan, but wrong in everything else.

I guess there's something wrong with the embedded orientation information in the image file. Why Irfan gets it right I don't know. Suggestion: open the image in another editor than the one you used earlier, turn it right if needed and save it again.

Posted by: Joe M Jul 9 2017, 07:40 PM

>>When I open the picture on my PC (via Windows Explorer), it opens it as it should as horizontal.

>In which device does it open vertically, a smartphone?

It's just my desktop PC (Windows XP). The same machine where is shows correctly in Windows Explorer.

Is there anyway to force this to horizontal using the Height and Width parameters on the "A HREF"?

Posted by: Christian J Jul 9 2017, 08:14 PM

QUOTE(Joe M @ Jul 10 2017, 02:40 AM) *

It's just my desktop PC (Windows XP). The same machine where is shows correctly in Windows Explorer.

In that case it might be something wrong with the image file, like pandy wrote.

QUOTE
Is there anyway to force this to horizontal using the Height and Width parameters on the "A HREF"?

Not with HTML. There are some tricks with CSS, but if the image file itself is broken I don't know what the result would be.


Posted by: pandy Jul 10 2017, 02:58 AM

CSS sounds risky. The image-orientation property can rotate the image, but it uses the image orientation information in the image file as a starting point - what else is there? So if there is a browser that gets it right (although it's probably wrong...) to start with it will show the image with the wrong orientation after the CSS treatment. It's always better to fix the problem than to try to mend it. In this case use an image file without errors.

Did you look in a desktop browser that got it right, Christian? If so which?

Posted by: Christian J Jul 10 2017, 06:37 AM

Opera12, IE11 and Edge get it right. Vivaldi and Firefox rotate.

Posted by: Joe M Jul 10 2017, 05:08 PM

I appreciate the help and replies. I'm glad to hear it doesn't appear to be an html coding problem.

It's not that big a deal. The image itself being wrong does give some explanation.

I'll just live with it as is I guess. Thanks again.

Posted by: pandy Jul 10 2017, 05:35 PM

Why? Just re-save it with another program.

BTW, just discovered that my other editor (Picture Window Pro) shows the image with the intended orientation if I copy it form the web and paste it in. But not when I save the image to my hard drive and open it the normal way.

Which leads me to wonder... Yes, Irfan also shows the not intended orientation when I open the saved image. So it's the Windows clipboard that somehow makes it right. Go figure. ohmy.gif

Posted by: Joe M Jul 10 2017, 07:19 PM

QUOTE(pandy @ Jul 10 2017, 05:35 PM) *

Why? Just re-save it with another program.


Doh! Thanks for the tip!

I opened it with Windows Picture and Fax Viewer. I rotated it 90 degrees and then rotated it back 90 degrees and saved it. It worked!

Thanks much!

Joe

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)