'gdouble' is invalid or out of range for property 'xres'
See original GitHub issueWhen working with medical slides, the resolution is often specified in mm
or even nm
scale. resunit
only accepts cm
and inches
, so by creating a WSI using tiffsave
the values becmoe very small:
slide.tiffsave('slide.tiff', compression='jpeg', Q=80, tile=True, tile_width=128, tile_height=128, pyramid=True, depth=3,
xres=0.00002333, yres=0.00002333, resunit='cm')
The values fall back to 28.3465 pixels/cm
with a warning:
GLib-GObject-WARNING **: 17:22:50.793: value "0.000023" of type 'gdouble' is invalid or out of range for property 'xres' of type 'gdouble'
GLib-GObject-WARNING **: 17:22:50.793: value "0.000023" of type 'gdouble' is invalid or out of range for property 'yres' of type 'gdouble'
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Height of the image become 0 during the resizing · Issue #2653
GLib-GObject-WARNING **: 12:34:55.444: value "nan" of type 'gdouble' is invalid or out of range for property 'vscale' of type 'gdouble' ...
Read more >GLib-GObject-WARNING **: value "-0.039333" of type ...
GLib-GObject-WARNING **: value "-0.039333" of type 'gdouble' is invalid or out of range for property ... Too many error messages in the system ......
Read more >VipsForeignSave - libvips
Write an image to a file in WebP format. By default, images are saved in lossy format, with Q giving the WebP quality...
Read more >Diff - 4b29fe6^! - platform/system/core - Git at Google
property name is updated. ... &immediate)) { + o4(0xE2800000 | immediate); // add r0, r0, #offset + } else { + error("structure offset...
Read more >MickyMike/large_c_corpus · Datasets at Hugging Face
free(fds); fds = NULL; goto out; } fds = tmp; } debug("Found an alias for the ... atoi(Buffer); if (index > max) FatalError("Named...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Huh you’re right, the tiff saver also clips the resolution:
That’ll need changing too. It looks like there’s no easy workaround, unfortunately. We should make this change as a bugfix for 8.13.
The tiffsaver writes the same metadata for all pyramid levels, so you’ll see the same resolution. Imagine if you were printing the pyramid levels next to each other: would you want the levels to all be printed as the same size on the paper, or would you like the smaller levels to be smaller? It depends.
There’s no single correct answer, so libvips avoids automatic resolution changes.
Yes, I think I solved my problem. Your comment from another discussion helped me