TransWikia.com

How to make a JPG files DCF compatible? (command line)

Photography Asked by feklee on April 2, 2021

At the moment I use Sony’s Imaging Edge Desktop to make
individual photos viewable in camera. However, this is cumbersome if
there are many pictures.

How can it be done from the command line?

According to the thread Make JPEG file DCF compatible in the
ExifTool Forum it’s possible with ExifTool, but so far I haven’t
succeeded. I tried copying EXIF data from an image taken with my
camera (Ricoh GR III):

exiftool -TagsFromFile R0000001.JPG -all:all -unsafe -XML:All R0000007.JPG

One Answer

Finally, with lots of help on the Internet, including the suggestion by @StarGeek, I got it to work. The required tools are:

You also need a photo taken with the camera, here:

R0000349.JPG

For testing, if you don't have an existing image, create one (can be any aspect ratio):

convert -size 2000x1000 radial-gradient:red-blue TEST.JPG

Then convert that image:

INPUT=TEST.JPG
OUTPUT=A0000001.JPG # DCF compatible
THUMBNAIL=THUMB.JPG
ORIGINAL=R0000349.JPG # taken with the camera
convert -sampling-factor 4:2:2 $INPUT $OUTPUT
exiftool -TagsFromFile $ORIGINAL -all:all -unsafe -XML:All -JFIF:ALL= $OUTPUT
convert $INPUT -resize 160x120 -background black -gravity center -extent 160x120 -sampling-factor 4:2:2 $THUMBNAIL
exiftool "-ThumbnailImage<=$THUMBNAIL" $OUTPUT

To set the orientation of the image, add another step:

ORIENTATION=1 # 1 = 0°, 3 = 180°, 6 = 90°, 8 = -90°
exiftool -Orientation=$ORIENTATION -n $OUTPUT

Finally, put $OUTPUT into a DCF compatible path on your camera.

Make sure that the number in the file name is unique on the card, or else the camera may be confused. For example, if there is A0000001.JPG and B0000001.JPG on the card, then my Ricoh GR III displays neither of the images.

Correct answer by feklee on April 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP