ExifThumb #16
-
I tried to extract the preview based on the code from here. file = "/Volumes/0001.NEF"
image = exiv2.ImageFactory.open(file)
image.readMetadata()
exifData = image.exifData()
thumb = exiv2.ExifThumb(exifData)
print('Thumbnail type:', thumb.mimeType())
data = thumb.copy()
thumb_im = PIL.Image.open(io.BytesIO(data.data())) It doesn’t get to the opening in PIL because |
Beta Was this translation helpful? Give feedback.
Answered by
jim-easterbrook
Nov 27, 2023
Replies: 1 comment 11 replies
-
Your NEF file probably doesn't have a thumbnail. Most raw formats use "preview" images (at various sizes) instead. The libexiv2 |
Beta Was this translation helpful? Give feedback.
11 replies
Answer selected by
telenkor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your NEF file probably doesn't have a thumbnail. Most raw formats use "preview" images (at various sizes) instead. The libexiv2
PreviewManager
class handles those. Here's how I do it in one of my applications: https://github.com/jim-easterbrook/Photini/blob/main/src/photini/exiv2.py#L482