grim icon indicating copy to clipboard operation
grim copied to clipboard

Investigate if it's possible to embed scale in image metadata

Open emersion opened this issue 7 years ago • 3 comments

  • http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.div.8
  • https://github.com/mapnik/mapnik/issues/2322

emersion avatar May 13 '18 16:05 emersion

Any ideas on how to implement it for png? It doesn't seem trivial using just cairo: https://lists.cairographics.org/archives/cairo/2017-February/027882.html

Ideas

  1. Edit file metadata after first writing it to disk using cairo (janky?)
  2. Stream output to a variable and then edit that before writing to disk (possible using cairo_surface_write_to_png_stream??)
  3. Basically recreate all the cairo png functions here just to add a call to png_set_pHYs

ammgws avatar Dec 10 '19 14:12 ammgws

Basically recreate all the cairo png functions here just to add a call to png_set_pHYs

We already do that for other formats, so why not.

emersion avatar Dec 13 '19 15:12 emersion

Fair enough. I might give it a go then.

ammgws avatar Dec 13 '19 15:12 ammgws