https://bugs.documentfoundation.org/show_bug.cgi?id=154020

            Bug ID: 154020
           Summary: DOC with Mac-Picts: images don't import
           Product: LibreOffice
           Version: 6.0.0.3 release
          Hardware: All
               URL: https://ask.libreoffice.org/t/dealing-with-pictures-in
                    -a-doc-file/88861/
                OS: All
            Status: UNCONFIRMED
          Keywords: bisected, regression
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mikekagan...@hotmail.com
                CC: armin.le.gr...@me.com, t...@libreoffice.org

Created attachment 185798
  --> https://bugs.documentfoundation.org/attachment.cgi?id=185798&action=edit
A sample DOC with Mac-Picts

The attached DOC contains ten images. Prior to version 6.0, four of those were
imported correctly, and the rest were lost. Since 6.0, all ten import as a
cross with a message "Use Word 6.0c or later to view Macintosh picture."

This happened in two stages. First, in the range
https://git.libreoffice.org/core/+log/c7470f5be441d8fe80155ff29605d74d5838be26%5E..208e66185b634ebc131121158f93f4f3ae4bd18e,
all the images got lost completely. Then in
https://git.libreoffice.org/core/+/b5f2402e023fb438341895ad0f81020571c5ec5a it
started to import as it does now.

The problem is in SwWW8ImplReader::ReadGrafFile, which expects
ReadWindowMetafile to increment the stream's position by the size of the
metafile, and *then* read the Mac-Pict. But the ReadWindowMetafile now restores
the original position, which breaks the following
SwWW8ImplReader::GetPictGrafFromStream operation.

Additionally, the ReadWindowMetafile now reads *everything* from the stream's
current position till the end. This results in the metafile containing the
garbage in the end (actually, the rest of the DOC); and this garbage is kept
when writing. So this command:

soffice --convert-to ODT "Conspiracy Theories.doc"

would create a file larger than 3 MB, while the original DOC is only 841 KB.

For comparison, the DOC re-saved in Word 97 to contain "normal" images, which
is 525 KB (will attach it in the next message), gets converted to a 522-KB ODT.

A different issue is the inability to read the last six images (in older
versions), the reference for which are, again, in the next attachment.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to