JPG filesize changes during import with autorotate ON

Etienne digikam at boeziek.nl
Sat May 11 18:57:12 BST 2024



Thanks Maik,

I went over the settings in Digikam .
Under Metadata => Behaviour => I unchecked changing the modification date. So now they are not changed anymore (default and recommendation is to keep it ON I understand due to other programs).

and
Under Metadata => Rotation => I set rotate by setting a flag instead of rotate by changing the content (default is rotating by changing content and lossy off I think; anyway, lossy was off here). This has stopped reducing the file sizes except for a few where they are reduced by 100KB now. I guess that is pure metadata reduction/cleanup empty spaces.

According to exiftool htmldump (thanks for the link) of 1 of the images the “JPEG Image Data" is 11,983,712 bytes on the SD Card (and also on the disk when I import with only the rotation flag).
When I import using rotating by changing content (allow lossly still turned OFF) the “JPEG Image Data” is reduced to 10,983,228 bytes.
I am not that familiar with exiftool, but I assume that the image itself is thus also reduced here by almost 1MB.
So lossless is also re-encoding the file? Or am I mistaken here?

I also see it removed empty spaces in the metadata blocks when comparing the htmldumps, that decreases the files a bit more.

(I always kept writing the rotation flag to metadata turned ON.)

I guess I will keep the “changing the content” OFF going forward as it seems safest here.

Etienne



Sent from my iPhone
> On 11 May 2024, at 17:25, Maik Qualmann <metzpinguin at gmail.com> wrote:
> 
> The modification date does not change here under Linux. It shouldn't change
> either because we copy the modification date.
> The difference in size between rotated images has often been discussed.
> Remember that lossless rotation always creates a completely new image. There
> are no image losses if the rotation can be performed without loss. You can
> specify in the digiKam settings that if lossless rotation cannot be carried
> out, lossy rotation will take place or not.
> Let's assume that camera images can usually be rotated without loss. All
> metdata is also copied from the original image to the new image. This can lead
> to a significant reduction in file size. Many camera manufacturers use padding
> areas between metadata (probably for performance reasons). ExifTool packages
> all metadata together. There is also an FAQ about this at ExifTool.
> 
> https://exiftool.org/faq.html (see 13a)
> 
> Maik
> 
> Am Samstag, 11. Mai 2024, 16:46:50 MESZ schrieb digikam at boeziek.nl:
>> Hello,
>> I am new to Digikam and used an existing Lightroom/CaptureOne
>> photo/filestructure with Digikam and imported those by adding a folder as a
>> collection without any issues. Very promising app, thanks for all the hard
>> work!
>> Background: I run MacOS 14.4.1 (latest) and Digikam 8.3. I shoot RAW + JPG
>> on a Fujiflm X-T2.
>> Yesterday I started importing photos from an SD Card into Digikam, using
>> "adding photos" as the USB didn't recognize my USB slot in my Thunderbolt
>> Pro Dock.
>> When I select auto-rotate/flip ON, I notice that all my JPEG's are changed.
>> Not only those that are rotated, but all of them have a new modification
>> date in Finder.
>> For the rotated ones, I also noticed the file sizes are reduced. E.g. a
>> 12.1MB JPEG on my SD card became 11MB after import on my disk or a 11.5MB
>> became 10.4MB. So over a megabyte is trimmed, some are only reduced by
>> 100KB.
>> Is that normal behaviour? Are all the JPEG's re-encoded during import? If
>> so, doesn't that mean you start losing quality as rewriting JPGs is not
>> recommended?
>> When I turn off the auto-rotate, then all files are imported unchanged.
>> Thanks,
>> Etienne




More information about the Digikam-users mailing list