Resized bitmap images are rendered differently by Firefox or Batik ('preserveAspectRatio' attribute not set)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
High
|
Tavmjong Bah |
Bug Description
Technical details of solution at:
https:/
extra explanation:
https:/
I have generated a couple of SVG that have embedded images with Inkscape
but after opening or files in firefox, I get everything perfectly rendered
except the images.
Reproducible: Always
Steps to Reproduce:
1.Print/Export any website with background images enabled to a PDF (i.e. using
FreePDFXP)
2.Import the PDF into Inkscape (embedding images)
3.Save the image in SVG format.
4.Open the SVG file in Firefox.
Actual Results:
After opening or files in firefox, I get everything perfectly rendered except
the images which look compressed. The files open fine in Inkscape.
Expected Results:
The embedded images in SVG should render fully as in the original WebSite/PDF.
Igor Lino (icampista) wrote : | #1 |
tags: | added: importing pdf |
su_v (suv-lp) wrote : | #2 |
Changed in inkscape: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
su_v (suv-lp) wrote : | #3 |
from the mozilla bug report:
> Ah, and that's because the meaning of |width="1" height="1"| is that the image
> should be fit into a 1x1 rectangle. _How_ it fits in there depends on the
> value of the preserveAspectRatio attribute. The default value if the attribute
> is not specified is "xMidYMid" according to section 7.8 of the SVG 1.1
> specification. The behavior of this is defined to be:
>
> Force uniform scaling.
> Align the midpoint X value of the element's ‘viewBox’ with the midpoint X
> value of the viewport.
> Align the midpoint Y value of the element's ‘viewBox’ with the midpoint Y
> value of the viewport.
>
> If I add preserveAspectR
> the way Inkscape does.
>
> So sounds like this is a bug in Inkscape: it's assuming an incorrect default
> value of preserveAspectR
Related issue reported in:
Bug #461467 in Inkscape: “Image scale saved incorrectly”
<https:/
After adding 'preserveAspect
su_v (suv-lp) wrote : | #4 |
Edited example from bug #461467 (attached to comment #7),
with 'preserveAspect
tags: |
added: bitmap transformations removed: importing pdf |
summary: |
- SVG with embedded images are not readable by Firefox or Baltik + Resized bitmap images are rendered differently by Firefox or Batik + ('preserveAspectRatio' attribute not set) |
su_v (suv-lp) wrote : | #5 |
from the Scalable Vector Graphics (SVG) 1.1 specification:
5.7 The ‘image’ element:
«If attribute ‘preserveAspect
<http://
5.8 The ‘preserveAspect
«For ‘image’ elements, ‘preserveAspect
<http://
su_v (suv-lp) wrote : | #6 |
Setting bug importance to 'High' in accordance with
<http://
"non-SVG-compliant output"
Changed in inkscape: | |
importance: | Medium → High |
tags: | added: svg |
su_v (suv-lp) wrote : | #7 |
Fixed for direct bitmap image import in r13020, for bitmap images of imported PDF files in r13023.
See also:
<http://
Changed in inkscape: | |
assignee: | nobody → Tavmjong Bah (tavmjong-free) |
milestone: | none → 0.91 |
status: | Confirmed → Fix Committed |
Magnes (magnesus2) wrote : | #8 |
I now have - after the fix - a weird problem - some images in my old SVG files have preserveAspectR
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Reproduced with Inkscape 0.48+devel r9701 on OS X 10.5.8 (poppler 0.12.4, cairo 1.8.10)
An imported PDF with embedded images and saved as SVG file only renders as expected in Inkscape, but looks different with regard to the scaling of the embedded bitmap from other renderers (e.g. Firefox 3.6.8, Safari 5.0, Opera 10.60 and Squiggle (Batik 1.7)).