-
Notifications
You must be signed in to change notification settings - Fork 31
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
workspace.save_image_file: set dpi on image.save, #343 #611
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this forward.
Looking up any existing image for DPI info (without making sure it's the original image) will work, as long as images only ever enter via this function (or some other DPI-preserving method).
Regarding (in)efficiency, we should immediately take action on the processor side, so the dpi
kwarg is used everywhere.
(BTW, if we split this into the opt-in / dpi-kwarg and fallback / find_files part, we will get a window where we can adapt processors without paying the costs already.)
dpi = (dpi, dpi) | ||
elif not dpi: | ||
# TODO - brittle, will this always find the original image? | ||
orig_img_file = self.mets.find_files(pageId=page_id, mimetype='//^image')[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must adapt for the generator now, I believe.
orig_img_file = self.mets.find_files(pageId=page_id, mimetype='//^image')[0] | |
orig_img_file = next(self.mets.find_files(pageId=page_id, mimetype='//^image', local_only=True)) |
Another idea I had: couldn't we at least try to force PIL.Image objects we ourselves produce ( |
No description provided.