Skip to content

Large icons may bloat when added as custom icons #354

@keepassium

Description

@keepassium

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions