#837 Mantis ID:8521 - Images only get stored as PNG in the database

open
nobody
None
3
2009-02-23
2009-02-23
omfgppc
No

Reporter: petebisson
Severity: Feature
Category: System
Project: xTupleApps

Version: 3.3.0

Description:
When adding an image to the system using the image class, the image gets converted to PNG using the QT defaults, assuming it is not already PNG.

This is hardcoded into image.cpp (line 164)
imageIo.setFormat("PNG");

If xTuple can read/write the image in it's original format, it should do so.

The QT defaults are set to do as high quality a conversion as possible, so the file sizes can grow dramatically, even before the UUEncoding.

Several versions of the same image (from the xtuple website) are attached to demonstrate this.

xtuple-erp.jpg : 9,058 bytes
Originally from http://www.xtuple.com/images/left-xterp.jpg

xtuple-erp.jpg.uue : 12,723 bytes
UUEncoded original jpg for reference

xtuple-erp.as_png_from_xtuple.png.uue : 17,087 bytes
The image_data created for the original image

xtuple-erp.as_png_from_xtuple.png : 12,184 bytes
The UUDecoded image_data

In this example, the UUencoded data stored in xTuple is nearly twice the size of the original file.

9,058 byte jpg -> 12,184 byte png -> 17,087 UUEncoded png

Steps to reproduce:

Additional information:

Read more at http://www.xtuple.org/mantis/view.php?id=8521

Discussion


Log in to post a comment.