Comments (8)
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.
from caesiumph.
Can i just drop them here? Or will they get compressed or something by github? Or should I e-mail them?
from caesiumph.
I think they won't be compressed by GitHub, but, just to be sure: caesiumph {at} saerasoft [dot] com
from caesiumph.
okay, email has been sent :)
from caesiumph.
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.
from caesiumph.
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
- compress images and send to the selected folder
- will now compare this folder with the temporary files?
Or will it be just on the fly image after image?
from caesiumph.
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:
- Compress the file into the new folder (or with a suffix)
- Compare sizes
- If the compressed is bigger, remove it and replace it with a copy of the original
Instead, if we want to overwrite them:
- Compress the file in a temporary folder (which is different everytime CaesiumPH is started)
- Compare sizes
- If the output is smaller, move the file from the temporary folder into the original one, overwriting the file (the original is actually being removed before moving the new one). If it's bigger, do nothing as the original is already in the right place
- Destroy the temporary folder on CaesiumPH exit
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.
from caesiumph.
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 ;)
from caesiumph.
Related Issues (18)
- Crash at launch on OS X 10.11.3 HOT 1
- Use OBS
- Add an installation guide for Linux in the Readme
- Malwarebytes catches CaesiumPH as ransomware on Windows 10 HOT 1
- JPEGs with corrupt headers crashes program HOT 2
- [linux] Can't find ui_caesium.h HOT 1
- Package for Linux distros HOT 2
- Deletes files when optimizing a large batch HOT 3
- Crashing while too many photo HOT 2
- (request) add drag drop folder HOT 1
- Most EXIF information get lost
- Rotation
- Sort by "Saved" - wrong listing HOT 1
- Adding more than one folder not working
- Adding total saving statistics HOT 2
- Progressive (Preferences) not working HOT 2
- Overflow of cumulative filesize for big collection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caesiumph.