-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
tiffsave xres/yres arguments don't match docstring #1421
Labels
Comments
Ooop, you're right, it's all messed up. I'll have a look. Thanks! |
jcupitt
added a commit
that referenced
this issue
Sep 4, 2019
and should have been in pixels/mm thanks f--f see #1421
I think it's working now. There was a *10 missing from one side of an if :-( Thanks again for reporting this, it'll be in 8.8.2.
|
😁 Looks good, thanks! |
I added some tests too: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed that the docstring for
tiffsave
describes the optionalxres
andyres
arguments like this:But running
pyvips.Image.grey(100, 100).tiffsave("grey.tif", xres=100, yres=100)
and then checking the result with tiffinfo outputs
Resolution: 100, 100 pixels/cm
(xres and yres in pixels/cm, and not pixels/mm - this is the case even if resunit is specified as inches).I suspect the confusion is that libvips stores xres/yres metadata in pixels/mm, which does get converted properly if it is specified in
tiffsave
.The relevant section of existing code for handling resolution units seems to be here:
libvips/libvips/foreign/tiffsave.c
Lines 145 to 165 in 2da56b9
(Using vips 8.8.0)
The text was updated successfully, but these errors were encountered: