Closed Voodoopupp closed 8 years ago
Definitely a), b) would be very confusing. Can you provide one or more of the images that actually have a size increase after compression? I'd like to have a look at them for testing purposes.
Can i just drop them here? Or will they get compressed or something by github? Or should I e-mail them?
I think they won't be compressed by GitHub, but, just to be sure: caesiumph {at} saerasoft [dot] com
okay, email has been sent :)
While I investigate on the compression results to completely avoid increasing the size - although it's impossible to be 100% sure it won't happen sometimes - there's the fix. Since we can't exactly predict the output filesize due to EXIF, the file is actually compressed and then the software will check whether the output is bigger or not. If this happens, the output file is removed and is replaced by a copy of it. More precisely, if we wanted to overwrite
the originals, the output files are actually compressed in a temporary directory and eventually moved over the originals. The temporary folder is destroyed when CaesiumPH is closed.
Sounds great, so if we won´t overwrite the originals, let's say we sent the compressed images to a custom folder or subfolder it will
Or will it be just on the fly image after image?
On the fly. For each compressed file, it performs the check and copy the original file into the subfolder/custom folder.
This is the flow if we don't want to overwrite the originals:
Instead, if we want to overwrite them:
This way is a bit slower than the previous process because we need to remove/move some files in a few cases, especially when overwriting them. Also, doing this on the fly for each file ensures the right behaviour upon cancelling the process or if an unexpected error kicks in.
Okay, sounds exaclty the right way. Sure, speed is a bit slower, but I think in the end the result is the more important thing ;)
If you have a lot of really small images and try to save size, it can happen that casesiumPH is increasing the file size (e.g. 6000_4.jpg in the screenshot)
This should be prevented and instead it should a) copy the original to the folder or b) skip that image
I would prefer a) because afterwards it would be a mess to check always both folders.
The only concern is the compression setting in the preferences ("Keep exif", ...) - not sure, how to handle that.