Bug 45239 - FILESAVE: Export to HTML - Use PNG for charts instead of JPG
Summary: FILESAVE: Export to HTML - Use PNG for charts instead of JPG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.4.5 release
Hardware: All All
: medium normal
Assignee: Josh Heidenreich
Whiteboard: target:3.6.0
Keywords: easyHack, skillCpp
Depends on:
Reported: 2012-01-25 11:23 UTC by famo
Modified: 2015-12-16 00:43 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Sample Spreadsheet with Line Chart (14.06 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-01-25 11:23 UTC, famo
Chart as JPG from HTML Export of the Sample Spreadsheet (13.28 KB, image/jpeg)
2012-01-25 11:25 UTC, famo
Chart as PNG from Sample Spreadsheet (exported via Draw) (8.74 KB, image/png)
2012-01-25 11:26 UTC, famo
Is this all that is needed? (715 bytes, patch)
2012-02-21 23:17 UTC, Josh Heidenreich

Note You need to log in before you can comment on or make changes to this bug.
Description famo 2012-01-25 11:23:37 UTC
Created attachment 56157 [details]
Sample Spreadsheet with Line Chart

When exporting a spreadsheet to HTML, charts and other graphic objects are exported as JPG - with a poor outcome (see attachments).

Instead of the lossy JPG compression, PNG should be used as the default graphic format for all graphic objects.

See also:

I filled this under spreadsheet, but it probably applies to more modules, so feel free to change.
Comment 1 famo 2012-01-25 11:25:18 UTC
Created attachment 56158 [details]
Chart as JPG from HTML Export of the Sample Spreadsheet
Comment 2 famo 2012-01-25 11:26:22 UTC
Created attachment 56159 [details]
Chart as PNG from Sample Spreadsheet (exported via Draw)
Comment 3 Eike Rathke 2012-01-30 04:15:20 UTC
No need for status NEEDINFO, changing to NEW.
Comment 4 Eike Rathke 2012-01-30 04:26:52 UTC
Making this an EasyHack with SkillCpp (for Calc, can't say anything about Writer or others)

In sc/source/filter/html/htmlexp2.cxx ScHTMLExport::WriteImage() change the filter name "JPG" to "png". Verify that for a sheet all graphics objects (images, charts, drawing objects, ...) are written as png instead of jpg, and identical objects share a file (i.e. not several files are generated for multiple occurrences of the same image).
Comment 5 Josh Heidenreich 2012-02-21 23:17:04 UTC
Created attachment 57435 [details]
Is this all that is needed?

Quickly put this together. Appears to work.
Comment 6 Eike Rathke 2012-02-22 06:09:22 UTC
If it works it's all that's needed :-)  Thanks!
Comment 7 Not Assigned 2012-02-22 06:22:20 UTC
Josh Heidenreich committed a patch related to this issue.
It has been pushed to "master":


resolved fdo#45239 EasyHack: use PNG instead of JPG in Calc to HTML export
Comment 8 famo 2012-02-22 15:05:04 UTC
Thanks, this was fast! :-)

Please, check if this can also be committed to 3.5 branch for 3.5.1.
Comment 9 Rainer Bielefeld Retired 2012-07-19 15:17:56 UTC
Modified assignee due to facts
Comment 10 Robinson Tryon (qubit) 2015-12-16 00:43:19 UTC
Migrating Whiteboard tags to Keywords: (EasyHack SkillCpp)