saving JPEG trailers

Started by Jaff, February 05, 2020, 10:59:50 PM

Previous topic - Next topic

Jaff

Please add option to save any data (trailer) found after JPEG ending. Samsung phone J320F Galaxy J3 (2016) stores the makernotes and Samsung trailer after JPEG ending. It can be very useful for those who rotate/edit/optimize files to save all this data and append it back after modifications. (sample file attached)

Phil Harvey

Sure.  I'll add a new Trailer tag that will allow you to read/write/copy/delete the JPEG trailer as a block.  This feature will appear in ExifTool 11.87

- Phil
...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 ($).

herb

Hello Phil,

thanks for the new version 11.87 of Exiftool and thanks for this new feature.

But please allow an additional question:
What is the best way to get information about an existing trailer?

exiftool.exe -trailer <file>              gives this information
exiftool.exe -all:all  <file>              does not give any information about a trailer
exiftool.exe -all:all -trailer <file>   gives 2 identical lines with info about the trailer

I think it would be very helpful when exiftool.exe -all:all <file> would give - a 1 line info - about an existing trailer.

Thanks for your comments in advance
Best regards
Herb

Phil Harvey

Hi Herb,

ExifTool just extracts any information it finds in the trailer.  You can use the -v or -htmldump option if you want more details.

Yes, -all:all -trailer will show the trailer twice because it is included in -all:all as well.

- Phil
...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 ($).

herb

Hello Phil,

thanks for your answer.
QuoteYes, -all:all -trailer will show the trailer twice because it is included in -all:all as well.
This is correct.
But therefore I ask this question, because only-all:all does not give a line like
Trailer       : (Binary data 9107 bytes, use -b option to extract)

For my tests I used the file attached by Jaff.

Best regards
Herb

Phil Harvey

Hi Herb,

If you look at the Extra Tags documentation, you will see that a number of the tags aren't extracted unless specifically requested.  Adding -trailer to the command line explicitly requests this tag, but also causes it to be displayed.  The API RequestTags option may be used to request a tag without displaying it, so I think you want to do this:

exiftool -api requesttags=trailer -all:all FILE

- Phil
...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 ($).

herb

Hello Phil,

thanks for the private lesson.

Best regards
Herb

herb

Hello Phil,

sorry, annoying you again: Is there a possibility to get information about the type of a trailer?

Ok, we can use -htmldump option, but I am thinking about a possibility to get this info together with display -all:all

Thanks in advance
Best regards
Herb

Phil Harvey

Hi Herb,

No, the trailer type is not identified in the ExifTool output, other than -htmldump or -v.

- Phil
...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 ($).