PDF import exploits viewBox Bug

Bug #230768 reported by ccprog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

This is a follow-up to Bug #166885 (https://bugs.launchpad.net/inkscape/+bug/166885)

On importing a PDF containing an embedded bitmap, you get something like this:
<g
  transform="matrix(2599.65,0,0,1949.74,141.732,141.732)"
  id="g2441">
  <image
    id="image2443"
    xlink:href="data:image/png;base64,..........." (shortened)
    transform="matrix(1,0,0,-1,0,1)"
    height="1"
    width="1" />
</g>

Appart from the strange upside/down flip, the important thing about this is: the image is initially scaled to a height and width of 1, and only subsequently stretched again to its original aspect ratio. This only works correctly assuming an attribute
preserveAspectRatio="none"

As Bug #166885 states correctly, this is not SVG-conformant (where preserveAspectRatio="xMinYMin meet" is stipulated as the default) and leads to other renderers displaying the image distorted. Additionally, fixing the above mentioned bug would lead to a faulty PDF import.

Revision history for this message
ccprog (ccprog) wrote :

For a life example of this behavior:

http://upload.wikimedia.org/wikipedia/de/archive/7/74/20080515130011!Obama08.svg - This file was produced as PDF import with Inkscape. (Source file and copyright issues are reported at http://de.wikipedia.org/wiki/Bild:Obama08.svg) Opening it with a SVG-enabled Browser like Firefox will show different results than Inkscape.

http://upload.wikimedia.org/wikipedia/de/7/74/Obama08.svg - This file uses correct aspect ratios for the embedded PNGs.

Revision history for this message
su_v (suv-lp) wrote :

More recently tracked in
- Bug #616717 “Resized bitmap images are rendered differently by Firefox or Batik ('preserveAspectRatio' attribute not set)”
- Bug #878984 “pdf import problem”
and
- Bug #461467 “Image scale saved incorrectly”
- Bug #924377 “wrong default value for image preserveAspectRatio”

Linking as duplicate to bug #616717.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.