Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large icons may bloat when added as custom icons #354

Closed
keepassium opened this issue Mar 27, 2024 · 1 comment
Closed

Large icons may bloat when added as custom icons #354

keepassium opened this issue Mar 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@keepassium
Copy link
Owner

Description

When adding a custom icon, KeePassium downscales large images to fit in 128x128 px. However, the images finally stored in the DB happen to be 2x or 3x of that size (so, 256x256 or 384x384 px)

How to reproduce
Steps to reproduce the behavior:

  1. Download a 130x130px (or larger) image and save it to device gallery
  2. Open some entry → Edit → tap icon → Change Icon → Plus → pick the image
  3. Save changes
  4. Open the database in KeePassXC, export the file to XML format, convert the CustomIcon from Base64 to binary format.
  5. Observe the image resolution is 384x384px.

Expected behavior
Image resolution should be 128x128px.

Environment:

  • Device: iPhone 15 (device) and iPhone 15 Pro Max (simulator)
  • OS: 17.4 (probably any)
  • App Version: 1.50.146 (and earlier)

Additional context

#353 [thanks, @ixs ]

Apparently, downsizing code uses points rather than pixels, so the intended image size becomes multiplied by display scaling factor.

@keepassium
Copy link
Owner Author

When tested on the 120x120px favicon of https://keepassium.com, the affected version saves a 384x384px PNG weighting 58 kB. Once fixed, it's a 120x120px with just 9.5 kB 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant