Changing exif tag orientation without rotating the image per se

Started by KurtJ, April 30, 2020, 10:07:27 AM

Previous topic - Next topic

KurtJ

I have some pictures (.jpg) used as asp:imagebutton but despite orientation tag = 1 or 3 the pictures are displayed upside down (rotated 180°).

Trying to rotate the images in different image-programs does not help. I assume that I have to change the orientation tag without rotating the image per se.

Can someone help me with a suggestion how I can do this?
I would be very grateful.

Sincerely
KJ
(experienced in VB.net, can auto translate c# to VB (or copy/paste C#), unexperienced in JAVA, Perl or other languages.) and too old to learn new languages (almost 80).

Phil Harvey

If the images are displayed the same despite the Orientation tag then they must be physically rotated using an image editor.  ExifTool will not do this for you.

But there are conflicting messages in your post.  ExifTool will change the Orientation tag without rotating the image, but from your first sentence I don't think this is what you want.

- Phil

P.S. Interesting that it seems you count Perl as a new language... it was created in 1987.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Though I don't have any experience with asp, I'd be a bit surprised if it recognized and followed an embedded tag like that. 

Using exiftool, you can change the Orientation and test it to see if it works.  The command would be something like one of these
exiftool -Orientation#=3 /path/to/file.jpg
exiftool -Orientation="Rotate 180"
exiftool -Orientation#=1 /path/to/file.jpg
exiftool -Orientation=Horizontal /path/to/file.jpg

If you want to use the Orientation number to set the tag, you need to add a hashtag to the end of it (see the -n (printConv) option).  Otherwise, you could use the human readable output that exiftool uses (see the EXIF tags page).


Quote from: Phil Harvey on April 30, 2020, 11:49:28 AMP.S. Interesting that it seems you count Perl as a new language... it was created in 1987.

I think they mean as in new to them i.e. a language they haven't learned, not as in brand new language.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Quote from: StarGeek on April 30, 2020, 12:09:46 PM
I think they mean as in new to them i.e. a language they haven't learned, not as in brand new language.

Yes, this does make a bit more sense. :)
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

KurtJ

Thank you Phil for those hints. After small permission problems they worked but did not solve my problem. But most of all, your doubts about use of embedded data encouraged me to more systematically dig deeper into the problem. When I replaced an image with another one (correctly rotated, renamed and working nice in another web-page), the page still showed the upside down original image on the imagebuttons, the solution struk me. Even local host use cached images.  Clearing the cached images/files solved my problem.
Again, thank you very much for help.  :)

By the way, Perl may be an old language - but would be new to me if I have to learn it. As English is not my mother language, there may be peculiar dangling modifier (correct expression?).

Best regards
Kurt J
MD, PhD