Coder Social home page Coder Social logo

Comments (11)

lovasoa avatar lovasoa commented on May 28, 2024 3

Hello,
The library we use to save jpeg images does not allow setting exif metadata (including DPI) on the image. Please note that the DPI is purely a meta-information, and has nothing to do with the actual quality of the image.
If you really want to set the DPI (I'd be curious to know what your use-case is), you can do it with, for instance, exiftool:

exiftool -XResolution=300 -YResolution=300 -ResolutionUnit=inches -overwrite_original your_image.jpg

A more interesting feature would be to allow the user to specify the quality parameter that is passed to the JPEG encoder for the final image creation (this feature was recently added to gapdecoder). If you are interested in that, feel free to open another issue.

from dezoomify-rs.

lovasoa avatar lovasoa commented on May 28, 2024 1

Ok, I'm reopening this, then !

Currently, the libraries we use do not have support for custom DPIs, but that's changing :

from dezoomify-rs.

lovasoa avatar lovasoa commented on May 28, 2024 1

dezoomify-rs uses what is called a software library to read and write JPEG files. The code of this library is not specific to dezoomify-rs, but is shared with many other projects. Once a new version of the library is released, and adds functions to read and write pixel density information, we will be able to use these functions to implement the functionality you wanted in dezoomify-rs. This may take a long time.

from dezoomify-rs.

lovasoa avatar lovasoa commented on May 28, 2024

If your request was indeed about DPI meta-information that is lost during dezooming and not image quality, then you can re-open this issue.

from dezoomify-rs.

Arekkusu1998 avatar Arekkusu1998 commented on May 28, 2024

Thank You very much, @lovasoa for Your promptness and for having kindly reported me about ExifTool and the system to recalibrate the parameters ...

exiftool -XResolution=300 -YResolution=300 -ResolutionUnit=inches -overwrite_original your_image.jpg

... although in substance it took almost half a day πŸ™„ to understand how it worked both for a single image and for a whole folder, now I know how to correct the DPI problem. Anyway, I know that DPI is a meta-info and has nothing to do with images' quality.

You also write:

If your request was indeed about DPI meta-information that is lost during dezooming and not image quality, then you can re-open this issue.

I don't know whether to do it or not: what I regret is that the original DPI.

from dezoomify-rs.

lovasoa avatar lovasoa commented on May 28, 2024

What exactly do you need the dpi information for ?

from dezoomify-rs.

Arekkusu1998 avatar Arekkusu1998 commented on May 28, 2024

The people I work with are meticulous: if maps are available at 300 dpi, they prefer that; and, since Milan & Venice State Archives have upload them at 300 dpi, I wanted to rectify this metadata.

from dezoomify-rs.

Arekkusu1998 avatar Arekkusu1998 commented on May 28, 2024

I'm glad to have aroused so much interest in the GitHub community, @lovasoa.
But I was wondering: since I understand very little about computer science, in the light of the threads mentioned by You above, how will dezoomify-rs changeπŸ€”? You've write that the idea to allow writing density information was accepted in image-rs/image#1078.

from dezoomify-rs.

Arekkusu1998 avatar Arekkusu1998 commented on May 28, 2024

Okay, that's fine @lovasoa: in the meantime that You experts 🧐 work on the software library, I'll use exiftool, as kindly indicated from You. Thanks and good work to everyone!

from dezoomify-rs.

Boscop avatar Boscop commented on May 28, 2024

Any update on this? :)

from dezoomify-rs.

lovasoa avatar lovasoa commented on May 28, 2024

The image library that we use, image-rs does not have any generic support for meta-information on image files. It can write DPI information (on jpeg files only), but not read it.

@Boscop: If you want to add support for this, the work starts in these external libraries: image-rs, jpeg-decoder, and other image format libraries if we want to support this feature for them too.

from dezoomify-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.