Issue 82100 - Picture as shape background converted to PNG instead of keeping its file format
Summary: Picture as shape background converted to PNG instead of keeping its file format
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: OOo 2.3
Hardware: All All
: P4 Trivial with 3 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
Depends on:
Reported: 2007-09-29 20:47 UTC by hagar_de_lest
Modified: 2017-05-20 11:26 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

sample document showing image change (49.72 KB, application/vnd.sun.xml.writer)
2007-10-04 03:33 UTC, Joe Smith
no flags Details
image used to create sample document (55.44 KB, image/jpeg)
2007-10-04 04:34 UTC, Joe Smith
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description hagar_de_lest 2007-09-29 20:47:27 UTC
Tested under Ubuntu with official OOo 2.3 version.

- In Writer, create a document, insert a shape (from the Drawing toolbar), add a
bitmap as background for this shape (imported a pic, 120 kB). Save. File size is
1.2 MB !
- In Draw or Calc, the file size is roughly the same as the pic (130 kB).

The pic in Writer is changed to .png instead of keeping its original file format
(jpg) as done in Draw (I checked the /Pictures folder in the files).
Comment 1 hagar_de_lest 2007-09-29 21:01:17 UTC
I forgot to add : no such issue with tables and frames backgrounds (which are
referenced as Graphics BTW, not Bitmaps).
Comment 2 eric.savary 2007-10-01 14:34:33 UTC
I cannot reproduce it.
Please attach the jpg you're talking about.
Which shape are you using.
Which version (build number)?
Comment 3 hagar_de_lest 2007-10-01 20:21:28 UTC
Please attach the jpg you're talking about.
-> I can't, private pic. Just try with any jpg on your system.

Which shape are you using.
-> Checked with rectangle and ellipse.
-> Note that I tried again with the same pic as yesterday and the file increases
just about the jpg size ! So I tried with a new jpg and the issue reappeared. It
seems that it depends if the bitmap had already been imported before or not. I
tried to close OOo (no quickstarter) and to do it again and same issue. Perhaps
OOo needs to get some rest before handling new files  !

Which version (build number)?
-> Don't know. It's the one downloaded from OOo web site, 2.3 final en-US
version, RPMs converted with alien (with French language pack). Provide this
information in the Help dialog and I'll tell you.
Comment 4 eric.savary 2007-10-02 14:40:24 UTC
Please contribute:
- if I tell you that I cannot reproduce it, that means that I tried it!
jpg = 100Kb, File=500Kb which is ok.

- If you can't attach this file here, send it via e-mail or try to build a
sample from scratch.

- Version number: go to the About dialog and type Ctrl+S,D,T.
Comment 5 hagar_de_lest 2007-10-02 20:38:11 UTC
Version is 680m5 build 9221.

I tried with other jpgs and same issue so it's not related to a specific file.

I could attach a file but there is nothing to be seen except that the jpg is
changed to png in the /Pictures folder of the odt.
Comment 6 hagar_de_lest 2007-10-03 20:21:08 UTC
Confirmed on OOo 2.3 on a Windows 2000 system. Taking randomly a jpg on the system.
Comment 7 ace_dent 2007-10-03 20:30:34 UTC
Probably relates to Issue 15508...
Comment 8 Joe Smith 2007-10-04 03:33:27 UTC
Created attachment 48690 [details]
sample document showing image change
Comment 9 Joe Smith 2007-10-04 04:33:41 UTC
Attached a Writer document showing change. The document was created with OOo 2.3
on Fedora Linux (680m5 build 9221).

Steps to create this document:
1) File > New > Text Document
2) Insert > Picture > From file; File > Save
3) List .odt archive contents and copy into document: Inserted image is native JPEG
4) Insert graphic circle shape from Drawing toolbar
5) Change area fill to Bitmap > Import > (pick same JPEG file as step 2)
6) File > Save
7) List .odt archive contents and copy into document: Image is now PNG

I noticed that the change does not happen with all JPEGs: I first tried a small
(1.4Kb) JPEG image, and the image was retained as JPEG after step 5.

Performing the same operation in Draw, using the same image (now in the bitmap
fill list), resulted in the original JPEG image being embedded in the file, with
no conversion to PNG.

Since JPEG is a lossy format, converting to PNG should not reduce the quality of
the image stored in the document, but the PNG image will usually be much larger
than the original JPEG. However, in the attached document, the PNG is _smaller_
than the original.

Images used for area filling are usually small patterns or textures, not
photographs, so for the common case, this issue should not cause a problem.
Comment 10 Joe Smith 2007-10-04 04:34:56 UTC
Created attachment 48692 [details]
image used to create sample document
Comment 11 eric.savary 2007-10-04 11:18:59 UTC
I'm sorry, I misunderstood the whole time the meaning of your report.
I thought you where focusing on the *size* of the file and not on the file type.

Comment 12 hagar_de_lest 2007-10-04 19:41:21 UTC
OK, no problem. I feared you were trying to "refuse" the bug !
Comment 13 ace_dent 2008-04-27 21:11:18 UTC
Part of this problem is that even png images are rewritten as a new png file,
losing potential file optimizations and meta data.
Tested with DEV300m10, WinXP- saving a file with background png image from
'standard.sob'. On inspection, the .odg and .sob do not contain (bit) identical
image files.
Imported pngs for background images should *not* be regenerated- original file
should be preserved. (However, this might have been a deliberate design choice
for speed / efficiency on image loading and rendering?).

It also (slightly) relates to Issue 50899 - 'File contains deleted graphics',
where these background images accrue in the odf file and are not removed.

Comment 14 Marcus 2017-05-20 11:24:36 UTC
Reset assigne to the default "".
Comment 15 Marcus 2017-05-20 11:26:01 UTC
Reset assigne to the default "".