Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIRT 4.15: SVG images won't be displayed on HTML-preview which are embedded on TEXT-element (type HTML) #1604

Closed
speckyspooky opened this issue Mar 24, 2024 · 6 comments
Assignees
Labels
BugFix Change to correct issues RELEASE BLOCKER Blocks the nearest release
Milestone

Comments

@speckyspooky
Copy link
Contributor

On my regression tests I found an issue with SVG-images which are embedded directly into a TEXT-element with type HTML.
The images won't be displayed longer on the HTML-preview.
The issue is given with BIRT 4.15 "nightly build" (and further versions of 4.15 2024).

BIRT 4.14 is correct and also the first BIRT 4.15 of December 2023 are fine.
I don't know which change cause the behavior. The problem is that till BIRT 4.14 the embedded SVG-images was directly embedded into the HTML-editor and the preview works fine.
The current 4.15 versions externalize the svg as file and the sources will be displayed like broken image.

As cross check, the output of PDF & DOCX works correct.

BIRT 4.15 nightly build

images415

BIRT 4.14

images414

image_issue_img_src.zip

@speckyspooky speckyspooky added RELEASE BLOCKER Blocks the nearest release BugFix Change to correct issues labels Mar 24, 2024
@speckyspooky speckyspooky added this to the 4.15 milestone Mar 24, 2024
@merks
Copy link
Contributor

merks commented Mar 24, 2024

If you do Open Image in New Tab it shows the content:

image

If I copy the content into a file, including adding the XML header, it still renders like this:

image

Only if the file extension is .svg does it render correctly:

image

@speckyspooky
Copy link
Contributor Author

Yes, of course with that extension it works. I have done a small change at 2 classes which checks "external" sources
and added the "data:"-URL-protocol key and the first try shows the old behavior where the svg-data-URL will be embedded.

It seems to me that the behavior is changed due to the changed tidy-parser behavior and therefore we got some effects.

I will take a look into the file extension way because there we would need a special role to get the extension from the URL.

@speckyspooky
Copy link
Contributor Author

@merks
I need your mind because I have 2 ways to solved it but which one is the better way (?)

Option 1) Restore the behavior like BIRT 4.14 with embedded SVG directly into the preview - 2 changes

  • changes are very small

Option 2) Change the behavior to get the correct file extension and use the file integration - 1 change

  • special case for the file extension creation
  • only "SVG" necessary because the embedded raster-images can be read directly without file extension

Attached the screen of the 2 changes on my notepad for compare.
My favorit would be "Option 2)" but I'm completely free and need a second opinion.

old-behavior-vs-new

@merks
Copy link
Contributor

merks commented Mar 24, 2024

My sense is that inline, option 1, would be better and more like what's specified in the report source.

@speckyspooky
Copy link
Contributor Author

PR #1605 created to fix the issue.

speckyspooky added a commit that referenced this issue Mar 24, 2024
* fix issue with embedded svg images added like data-URL (#1604)
@speckyspooky
Copy link
Contributor Author

The retest with the nightly build was successful and the images will be displayed according to BIRT4.14

@speckyspooky speckyspooky self-assigned this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFix Change to correct issues RELEASE BLOCKER Blocks the nearest release
Projects
None yet
Development

No branches or pull requests

2 participants