On importing a photo/image into your safe, pwSafe will optimize the image by default, unless this option is deselected in the import dialog.
Why?
The primary focus of the optimization is to reduce the size of the image file. As mobile phones are equipped with very high resolution cameras, regular photos can easily grow to 10 or 20 MB in size (even larger if raw mode is enabled).
Storing these kind of images inside your safe will make your safe grow in size quickly, which is not desirable for multiple reasons
- Delay: On opening your safe, the complete database is read. A large database will cause a delay each time your database is opened. The same holds when committing changes to your database, the entire database needs to be written to disk.
- Resources: all file attachments are kept (encrypted) in memory. Although most devices have lots of memory available these days, this is a waste of resources, especially on mobile devices. The operating system can also put restrictions on memory usage. For instance, the autoFill extension cannot use more than 120 MB of RAM on iOS.
- Synchronization: you are probably syncing your database between multiple devices. The larger the database the longer it takes for the synchronization to complete. The probability of a synchronization error also increases with the size of the database.
How?
The current optimization logic is extremely simple yet effective: pwSafe tries to reduce the total image size to be under 250 KB by scaling it down (one attempt). The aim is to strike the balance between being able to view the image with good quality, and keeping the image size low.
This algorithm can be improved in multiple ways, we have chosen to start with this simple approach to be able to improve the algorithm based on your feedback.
Please leave a comment below if the optimization needs improvement for your use-case!
Comments
0 comments
Please sign in to leave a comment.