Issue 119037 - Scaled images are malformed on document recall
Summary: Scaled images are malformed on document recall
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 3.4.1
Hardware: PC Windows 7
: P2 Major (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: http://musing.us/OpenOffice/Sangioves...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-08 20:00 UTC by Steve Shaffer
Modified: 2017-05-20 10:31 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Steve Shaffer 2012-03-08 20:00:37 UTC
Using either a png or jpg image embedded or lined into a document.  Scale the image and save the document.   Exit OO and then open the image for later editing.  The image area is preserved but the image is malformed or not visible.  If optimal wrapping is used with contour the contour is also lost.

Workaround is to scale the image with an external program and do not resize inside OO.

Two files attached are the same except 
2009 Sangiovese_broken.odt has a scaled image which will not display on multiple PC's
Comment 1 Steve Shaffer 2012-03-08 20:10:17 UTC
Examples of broken and working files are available at: 
http://musing.us/OpenOffice/Sangiovese.zip (contains both files)

Working file with externally scaled image:
http://musing.us/OpenOffice/Sangiovese.odt
Broken file with internally scaled image:
http://musing.us/OpenOffice/Sangiovese_broken.odt
Comment 2 Jose D. Garcia 2012-06-14 03:48:49 UTC
Tried to replicate the problem and I followed the steps below:

1) Created new document in OpenOffice Writer

2) Added 567 words to the document

3) Clicked on Insert -> Picture -> From File

4) Attached JPEG (.jpg) file to the document

5) Resized image to about 40 percent larger of the original size.

6) Saved document

7) Closed OpenOffice

8) Opened the document again

I was not able to confirm the bug. For some reason when I open your files, I can see the bug that you specified in the report when I followed the same steps, I am not able to replicate the problem.

I am not sure if you are omitting some steps or perhaps the exact configuration you used (ie. image left or right justified, type of wrap around for the word around the image, etc).
Comment 3 Jose D. Garcia 2012-06-14 04:01:31 UTC
You can download the example I created in the link below: 

https://hotfile.com/dl/159741681/5f5342d/Test.odt.html


(In reply to comment #2)
> Tried to replicate the problem and I followed the steps below:
> 
> 1) Created new document in OpenOffice Writer
> 
> 2) Added 567 words to the document
> 
> 3) Clicked on Insert -> Picture -> From File
> 
> 4) Attached JPEG (.jpg) file to the document
> 
> 5) Resized image to about 40 percent larger of the original size.
> 
> 6) Saved document
> 
> 7) Closed OpenOffice
> 
> 8) Opened the document again
> 
> I was not able to confirm the bug. For some reason when I open your files, I
> can see the bug that you specified in the report when I followed the same
> steps, I am not able to replicate the problem.
> 
> I am not sure if you are omitting some steps or perhaps the exact
> configuration you used (ie. image left or right justified, type of wrap
> around for the word around the image, etc).
Comment 4 Cem Kaner 2012-06-21 18:55:26 UTC
Version 3.4.0 version 340m1 (Build 9590)
Windows 7 64-bit

Jose and I followed up on this with the following results.

(1) I opened the original two files and saw the corrupted image (well, saw a fragment of it) in the "broken" document and saw the full image in the other document.

(2) I saved the broken document under a new name (foo.odt) to be able to edit it. I then played with the "Picture" options. (Right-click on the image to bring up the picture dialog). As soon as I changed the wrapping (from optimal to none), the full picture reappeared. I could return to optimal wrapping and the picture was still visible. I saved and reopened and the picture was available.

(3) I tried resizing the picture from the Type pane and from the Crop pane. In both cases, the picture changed size (either proportionally or changed shape too). When I saved and reopened, the picture looked OK.
Comment 5 Steve Shaffer 2012-06-22 18:36:31 UTC
Jose and Cem,
I've been tinkering with the test.odt and can not get it to fail but a couple of things to consider.  
The file I sent works without using contour. (the test image works fine with contour turned on).

The source image was a .png file (I'll upload that if you think it would help)

Could there be a race condition between determining the contour mask and loading the image?

Regards
Steve

P.S.  Sorry for the slow response but the emails ended in my spam folder
Comment 6 Cem Kaner 2012-06-22 19:09:16 UTC
Steve:

I'm not familiar with the source code and don't know how to identify race conditions. We did things slowly and deliberately, so I don't think that timing plays a role in any of our work.

My involvement on this project is as a teaching professor. Students in my courses pick unconfirmed bugs in the OOo database and add replication (or failure) data. I review their work with them. Sometimes I realize that I should extend their notes as I review them, so you see me get involved in that way. I also train other instructors to do this in their courses. Beyond that, I have no real role in the OOo project (except "user").
Comment 7 ajkrause 2012-10-01 02:18:53 UTC
I also attempted to replicate the bug and failed, testing with a PNG instead of a JPG image as Jose did:

1) Created new document in OpenOffice Writer

2) Added 483 words to the document

3) Clicked on Insert -> Picture -> From File

4) Attached PNG (.png) file to the document

5) Resized image to about 40 percent larger of the original size.

6) Changed the overall shape from a rectangle to a square

7) Changed the word wrap (from right-click menu on image) from "No Wrap" to "optimal page wrap" 

8) Saved document

9) Closed OpenOffice

10) Opened the document again

I attempted this with both .odt and .doc files. In both cases, the image appeared the same before and after the saving and closing operations.

Configuration: Windows 8, OpenOffice 3.4.1 build 9593
Comment 8 mjcervan 2012-10-01 05:52:43 UTC
I attempted to replicate the bug using the previously outlined procedures:

1) Created new document in OpenOffice Writer

2) Added 249 words to the document

3) Clicked on Insert -> Picture -> From File

4) Attached JPG (.jpg) file to the document

5) Re sized image to about 20 percent larger of the original size.

6) Rotated the image upside down.

7) Changed the word wrap (from right-click menu on image) from "No Wrap" to "optimal page wrap" 

8) Saved document

9) Closed OpenOffice

10) Opened the document again

I saved the document in two different formats using the following options in the save as drop down “ODF Text Document (.odt)(*.odt)” and “Microsoft Word 97/2000/XP (.doc)(*.doc)”  The only issue I ran into was that when the file was saved in the word format the image was no longer upside down.

Configuration: Windows 7, OpenOffice 3.4.1 build 9593
Comment 9 brtucker 2012-10-02 17:29:42 UTC
I attempted to replicate the bug using the these procedures:

1) Created new document in OpenOffice Writer

2) Added 3000 words to the document

3) Clicked on Insert -> Picture -> From File

4) Attached PNG (.png) file to the document

5) Re sized image to about 30 percent larger of the original size.

6) Saved document

7) Closed OpenOffice

8) Opened the document again

I saved the document in two formats using the (.odt) and (.doc) functionality. The issue did present itself when it was reopened and the image was scaled back to its original size.

Configuration: Mac OS X 10.8.2, OpenOffice 3.4.1 build 9593
Comment 10 Luis Kantun 2012-12-01 20:16:21 UTC
Hello, Steve Shaffer looks have made ​​the example you propose. I recommend e OO 3.4 I had no problems in terms of image quality and in that I stick out dañandas images.
if enrealidad think was a problem was solved for OO 3.4.1 I hope I helped found.
if not please ask him to describe a little more if the problem
regards

(In reply to comment #0)
> Usando una imagen png o jpg incrustado o forrado en un documento. Escalar la
> imagen y guardar el documento. Salir OO y luego abra la imagen para su
> posterior edición. El área de la imagen se conserva, pero la imagen es
> incorrecto o no visible. Si desea un embalaje óptimo es usado con el
> contorno del contorno también se pierde.
> 
> La solución consiste en escalar la imagen con un programa externo y no
> cambiar el tamaño interior OO.
> 
> Dos archivos adjuntos son iguales, excepto 
> 2009 Sangiovese_broken.odt tiene una imagen escalada que no se mostrará en
> múltiples PCs
Comment 11 Steve Shaffer 2012-12-02 06:44:37 UTC
The problem still exists in 3.4.1 try the original examples.
I did not clearly specify the image was reduced in size from the original to trigger this bug.

The work around for this problem is to size the image with an external tool (such as GIMP) to the size needed in the document.
Comment 12 Steve Shaffer 2012-12-02 06:51:16 UTC
Just re-tried examples in 3.4.1 and it now works.  Previous attempt to look at the file was using a read-only downloaded copy.