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

Image size is incorrectly set; DPI conversion called twice #156

Closed
PhenX opened this issue Dec 6, 2012 · 2 comments
Closed

Image size is incorrectly set; DPI conversion called twice #156

PhenX opened this issue Dec 6, 2012 · 2 comments

Comments

@PhenX
Copy link
Member

PhenX commented Dec 6, 2012

Original author: dani.chu (May 11, 2010 20:35:09)

What steps will reproduce the problem?

  1. Set DOMPDF_DPI to 300
  2. Convert an HTML file with a linked image with a width of 600 pixels (do
    not set width anywhere)

What is the expected output? What do you see instead?
I expect to see a 2-inch-wide image. Instead, it's tiny.

What version of the product are you using? On what operating system?
0.6.0-beta1, Linux

Please provide any additional information below.
The issue is in image_frame_reflower.cls.php, lines 104 and 122. It
applies the DPI conversion any time it sees a non-percentage dimension.
However, in the previous call to get_min_max_width, at lines 138 and 139 it
sets the dimensions to the DPI-converted values, measured in pt. The fix
is to check on lines 104 and 122 to see if the value is already in pt, and
if so do not re-convert:

104: } elseif (false === mb_strpos($width, 'pt')) {
122: } elseif (false === mb_strpos($height, 'pt')) {

Original issue: http://code.google.com/p/dompdf/issues/detail?id=150

@PhenX
Copy link
Member Author

PhenX commented Dec 6, 2012

From att on June 10, 2010 19:01:25
I ran into the same problem using DOMPDF_DPI=96 and your fix is working fine.

@PhenX
Copy link
Member Author

PhenX commented Dec 6, 2012

From fabien.menager on August 02, 2010 20:57:01
Fixed by r283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant