0
\$\begingroup\$

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
\$\endgroup\$
7
  • \$\begingroup\$ ...but so far I haven’t succeeded. Glad to see that you've tried already. Could you please share what commands/scripts/methods you used so far and what their (non-successful) outcome was? Also, what's the final goal of uploading photos to your camera? \$\endgroup\$ Commented Jul 29, 2020 at 12:46
  • \$\begingroup\$ I basically tried copying all EXIF data from an image that I took with the camera. The goal is to view pictures on the camera that come from elsewhere. It works, just with that Sony tool, I think there is no batch option. \$\endgroup\$
    – feklee
    Commented Jul 29, 2020 at 13:15
  • \$\begingroup\$ How did you try copying all EXIF data? Feel free to rewrite your question and include the command that you used for that. I understand that you want to view the pictures on camera, but is that really the end-goal? I suspect you want to view them on camera for a certain purpose. If you can include that purpose in your question, there might be other methods to achieve the same end-goal. \$\endgroup\$ Commented Jul 29, 2020 at 13:37
  • \$\begingroup\$ The end-goal is to view pictures in the camera. \$\endgroup\$
    – feklee
    Commented Jul 29, 2020 at 13:46
  • 2
    \$\begingroup\$ Did you delete any JFIF blocks as per that thread? You would add -JFIF:ALL= to your command. \$\endgroup\$
    – StarGeek
    Commented Jul 29, 2020 at 14:52

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$

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