Orientation Correction Help

Started by deomonizer, July 21, 2023, 02:36:07 PM

Previous topic - Next topic

deomonizer

I have an application that takes in images, but something it can't handle are images with an orientation of rotate 180. So for images that are upside down with the wrong orientation tag (horizontal normal), when I try to change the meta data to rotate 180, it flips to the correct orientation, but has the wrong meta data and so cannot be processed by my application. Any help would be appreciated.

StarGeek

What is the command you are using? What is the "wrong metadata"?  What is the program you are using that can't read the data? What type of file?

You're not giving us any useful information.

Exiftool writes data according to the various standards and if just changing the Orientation tag means your other program can't read it, then that program isn't following the standards.
* 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).

deomonizer

Quote from: StarGeek on July 24, 2023, 08:58:41 PMWhat is the command you are using? What is the "wrong metadata"?  What is the program you are using that can't read the data? What type of file?

You're not giving us any useful information.

Exiftool writes data according to the various standards and if just changing the Orientation tag means your other program can't read it, then that program isn't following the standards.


I believe that I that I gave all of that information. The files are images (jpgs normally), and the wrong meta data is that it says that the orientation is horizontal normal even though it is an upside down picture. I am just using exiftool -Orientation to check it. That is indeed the issue, I literally said that the program is not following standards and so I was asking for a solution.

StarGeek

Quote from: deomonizer on July 27, 2023, 04:00:56 PMthe wrong meta data is that it says that the orientation is horizontal normal even though it is an upside down picture.

Try setting the Orientation to "Rotate 180"
exiftool -Orientation="Rotate 180" /path/to/files/
* 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).

deomonizer

Quote from: StarGeek on July 27, 2023, 05:08:11 PM
Quote from: deomonizer on July 27, 2023, 04:00:56 PMthe wrong meta data is that it says that the orientation is horizontal normal even though it is an upside down picture.

Try setting the Orientation to "Rotate 180"
exiftool -Orientation="Rotate 180" /path/to/files/

Thanks for trying to help. Like I said, setting it to rotate 180 does set it to the right orientation, but my application cannot ingest rotate 180 images. Is there a way to completely reset the orientation?

StarGeek

There's nothing to reset. If your program refuses to honor the Orientation tag, then there's nothing exiftool can do.  This is a problem with the program you're using.

Jpegs can be losslessly rotated as long as the image dimensions are divisible by 16 or sometimes 8, depending upon the image's MCU block (Minimum Coded Unit). On the command line, there's a program called JpegTran which can do this.  There are also plenty of programs based upon the JpegTran code that can do lossless rotation.  There are some examples on the JPEG wikipedia page.  For example, on Windows you can use Irfanview with the lossless jpeg plugin.

* 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).

Alan Clifford

Quote from: deomonizer on July 27, 2023, 06:52:00 PM
Quote from: StarGeek on July 27, 2023, 05:08:11 PM
Quote from: deomonizer on July 27, 2023, 04:00:56 PMthe wrong meta data is that it says that the orientation is horizontal normal even though it is an upside down picture.

Try setting the Orientation to "Rotate 180"
exiftool -Orientation="Rotate 180" /path/to/files/

Thanks for trying to help. Like I said, setting it to rotate 180 does set it to the right orientation, but my application cannot ingest rotate 180 images. Is there a way to completely reset the orientation?

As Stargeek suggested, try physically rotating the file, something like:

jpegtran -rotate 180 original.jpg > rotated.jpg

but check the syntax of this command!