I'm not interested at converting it, but extracting the thumbnail JPEG.

  • What is the camera model?
    – xenoid
    Aug 6 '19 at 8:12

Using either exiftool or exiv2.

For example:

exiftool -b -previewImage -w .jpg foo.cr2


exiv2 -ep foo.cr2

If either tool is complaining about an invalid CR2 file, it's possible you have a newer camera and need a newer version of the tool. Canon does occasionally make tweaks to raw file formats that software needs to catch up on...

  • exiftool says what the rest of them are saying "invalid file" which is not i can open them with photoshop and i can see the jpeg with XNview and other programs and exiv2 has no version for Microsoft windows. It has a version for Microsoft visual studio but i haven't a clue how to use that.
    – S M
    Aug 5 '19 at 21:14
  • @SM The first three results that come up when I Google "exiv2 for Windows" all appear to have available downloads for Windows...
    – twalberg
    Aug 6 '19 at 0:36
  • That should be -PreviewImage (uppercase P), but I think the OP wants -ThumbnailImage anyway.
    – xenoid
    Aug 6 '19 at 8:22
  • AFAIK the CR2 is mostly a TIFF and this overall structure doesn't change between camera models. Unless the OP means "CR3".
    – xenoid
    Aug 6 '19 at 8:29
  • @xenoid Yes, the TIFF structure itself doesn't change, but the contents and format of the payload of one or more of the sections within the container may occasionally be tweaked. And some software is more sensitive to that than others, if it's looking for specific things that either moved, or changed format...
    – twalberg
    Aug 6 '19 at 11:01

Try dcraw. dcraw -e will extract the thumbnail.

Not the answer you're looking for? Browse other questions tagged or ask your own question.