Bug 149545 - SVG "Read Error" message after saving and reopening ODT file
Summary: SVG "Read Error" message after saving and reopening ODT file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:24.2.0 target:7.6.2 target:7.5.7
Keywords:
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2022-06-13 08:33 UTC by patrice.karatchentzeff
Modified: 2023-09-19 10:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
original SVG file (111.38 KB, image/svg+xml)
2022-06-13 08:34 UTC, patrice.karatchentzeff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description patrice.karatchentzeff 2022-06-13 08:33:20 UTC
Description:
Hi,

When you import the attached SVG files, they can be read normaly, but when you close and start again Write, they can't.




Steps to Reproduce:
1. Import SVG file as image
2. Image look like correct
3. Save and close the file
4. Open again
5. SVG image are marked as 'read error'

Actual Results:
SVG files are marked as 'read error'. No display.

Expected Results:
Display as like when they imported the first time.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
This bug does not concern all the SVG files. Only the two attached files (taken from Wikipedia):

https://fr.wikipedia.org/wiki/Fichier:Clavier-Azerty.svg
https://fr.wikipedia.org/wiki/Fichier:KB_France_Linux.svg
Comment 1 patrice.karatchentzeff 2022-06-13 08:34:22 UTC
Created attachment 180717 [details]
original SVG file
Comment 2 Rafael Lima 2022-06-13 22:41:11 UTC
Repro with:

Version: 7.3.3.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 12; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.3~rc2-0ubuntu0.21.10.1~lo1
Calc: threaded

And also in

Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: b2467d6c7af988f8ed4e090ebf9472be6c84fb06
CPU threads: 12; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL

I downloaded the SVG file, dragged the file into Writer and it was shown as expected. After saving the ODT file and reopening it, I get a "Read Error" message inside the image frame.

I'm setting this to NEW.
Comment 3 Xisco Faulí 2023-09-12 10:57:29 UTC
The image fails to load because the comment at the beginning is too large
Comment 4 Xisco Faulí 2023-09-12 11:22:07 UTC
(In reply to Xisco Faulí from comment #3)
> The image fails to load because the comment at the beginning is too large

it seems it fails in

           const ErrCode nGraphicFilterErrorCode(
                aGraphicFilter.ImportGraphic(aGraphic, u"", *aStream));

            if(ERRCODE_NONE != nGraphicFilterErrorCode)
            {
                // SVG import error, cannot continue
                break;
            }

in filter/source/svg/svgfilter.cxx
Comment 5 Commit Notification 2023-09-12 19:22:03 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fb07dcf993bd3ff7880b26414e4095560c296d8b

tdf#149545: increase svg check size

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2023-09-12 21:01:13 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/235ebd321bb89f0c1c103c4c7ae88f9ddf291a7f

tdf#149545: increase svg check size

It will be available in 7.6.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2023-09-19 10:12:33 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/f13faf35bc62c9804ecacf2059ad724bc3cb2f24

tdf#149545: increase svg check size

It will be available in 7.5.7.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.