Lymphatus / caesium-image-compressor

Caesium is an image compression software that helps you store, send and share digital pictures, supporting JPG, PNG, WebP and TIFF formats. You can quickly reduce the file size (and resolution, if you want) by preserving the overall quality of the image.
https://saerasoft.com/caesium
GNU General Public License v3.0
3.47k stars 209 forks source link

jpg to webp exif meta data all lost #226

Open XeonG opened 1 year ago

XeonG commented 1 year ago

seems to work fine converting to png, however webp files don't have any of the metadata in them.. tried a few different files.

latest version just downloaded it to try out.

Lymphatus commented 12 months ago

I want to point out something I was saying a few months ago, when Caesium did not have conversion all together (taken from https://github.com/Lymphatus/caesium-image-compressor/issues/80#issuecomment-951631523):

Doing conversions in the right way would totally be a whole new project by itself. It's quite hard to do.

As you can see in #196 there're many many options you can set while converting from JPEG to WebP, many of them are quite advanced. Caesium conversion feature is very basic and generic, trying to appeal to most of the users. Unfortunately, I don't have the knowledge and/or resources to improve that aspect right now. This may change in the future.

I suggest you to use a more advanced tool to convert your images to WebP and then use Caesium to adjust compression, if you need it.

XeonG commented 12 months ago

I don't get it.. would have thought transfering the metadata over to another format would just be a no brainer option, given the only reason someone would do any of this is just to get a better quality/size ratio and not lose information from the image.... like what many other options are people wanting.. I guess could advertise a new feature it supports in that it will wipe the metadata on conversion.

I guess if it is just a compressor.. what other stuff would you recommend that does everything?

Lymphatus commented 12 months ago

I think there's a lot of confusion related to the word "compression". If we stick to the literal meaning, Caesium should never change the file format. By going to JPG to WebP, you might get a smaller image, but you are not compressing, you are converting. As a side effect, the image is smaller because the target format is better optimized.

Let's get a little technical here: Caesium performs conversion by using the default QImage class shipped with Qt6, which is very handy but also very basic. If I want to allow metadata to be passed from one format to another, I would just need to stop using QImage and start doing it by myself, using specific libraries for each format. Don't get me wrong, it's absolutely possible to do so, but:

Unfortunately, I don't have the knowledge and/or resources to improve that aspect right now

Based on the data I have, only around 3% of Caesium compression are to WebP. I need to prioritize other things first before perfecting something that is quite niche.

Saijin-Naib commented 11 months ago

@XeonG, I've not found a tool to do it all yet, but I'm hoping to open a PR with Curtail by Huluti with my preferred WebP encoding options once they get back to me.

Lymphatus commented 1 month ago

Reopening this because I'm starting to support conversion inside libcaesium. You can follow the issue here https://github.com/Lymphatus/libcaesium/issues/21

This should allow to retain metadata info even while converting