ultramango / gear360pano

Simple script to create equirectangular panorama by stitching images from Samsung Gear 360
MIT License
226 stars 55 forks source link

preserve exif tags #13

Closed ftoledo closed 7 years ago

ftoledo commented 7 years ago

Is posible to retain the exif tags from the original image?

Original:

ExifTool Version Number         : 10.36
File Name                       : 360_0002.JPG
Directory                       : .
File Size                       : 9.3 MB
File Modification Date/Time     : 2017:01:01 16:15:14-03:00
File Access Date/Time           : 2017:01:04 23:26:56-03:00
File Inode Change Date/Time     : 2017:01:02 17:28:00-03:00
File Permissions                : rwxr-----
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Image Description               : SAMSUNG
Make                            : SAMSUNG
Camera Model Name               : SM-C200
Orientation                     : Horizontal (normal)
X Resolution                    : 350
Y Resolution                    : 350
Resolution Unit                 : inches
Software                        : 0.76
Modify Date                     : 2017:01:01 16:15:13
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/30
F Number                        : 2.0
Exposure Program                : Program AE
ISO                             : 320
Exif Version                    : 0230
Date/Time Original              : 2017:01:01 16:15:13
Create Date                     : 2017:01:01 16:15:13
Components Configuration        : Y, Cb, Cr, -
Exposure Compensation           : 0
Max Aperture Value              : 1.0
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 1.2 mm
Maker Note Version              : 0100
Device Type                     : High-end NX Camera
Samsung Model ID                : Various Models (0x5001038)
Smart Album Color               : n/a
Picture Wizard Mode             : Standard
Picture Wizard Color            : 65535
Picture Wizard Saturation       : -4
Picture Wizard Sharpness        : -4
Picture Wizard Contrast         : -4
White Balance Setup             : Auto
Raw Data Byte Order             : Little-endian (Intel, II)
Camera Temperature              : undef
Face Detect                     : Off
Face Recognition                : Off
Face Name                       : 
Pitch Angle                     : -3.5
Roll Angle                      : -0.2
Firmware Name                   : 0
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 7776
Exif Image Height               : 3888
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Sensing Method                  : One-chip color area
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 6 mm
Scene Capture Type              : Standard
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Compression                     : JPEG (old-style)
Thumbnail Offset                : 36146
Thumbnail Length                : 13889
MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : Dependent child image
MP Image Format                 : JPEG
MP Image Type                   : Large Thumbnail (VGA equivalent)
MP Image Length                 : 729680
MP Image Start                  : 9026302
Dependent Image 1 Entry Number  : 1920
Dependent Image 2 Entry Number  : 960
Image Width                     : 7776
Image Height                    : 3888
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Time Stamp                      : 2017:01:01 16:15:14-03:00
Aperture                        : 2.0
Image Size                      : 7776x3888
Preview Image                   : (Binary data 729680 bytes, use -b option to extract)
Megapixels                      : 30.2
Scale Factor To 35 mm Equivalent: 5.0
Shutter Speed                   : 1/30
Thumbnail Image                 : (Binary data 13889 bytes, use -b option to extract)
Circle Of Confusion             : 0.006 mm
Field Of View                   : 143.1 deg
Focal Length                    : 1.2 mm (35 mm equivalent: 6.0 mm)
Hyperfocal Distance             : 0.12 m
Light Value                     : 5.2

Processed:

ExifTool Version Number         : 10.36
File Name                       : 360_0002_pano.jpg
Directory                       : .
File Size                       : 5.6 MB
File Modification Date/Time     : 2017:01:04 23:30:13-03:00
File Access Date/Time           : 2017:01:04 23:30:35-03:00
File Inode Change Date/Time     : 2017:01:04 23:30:13-03:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 1
Y Resolution                    : 1
Image Width                     : 7776
Image Height                    : 2246
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:4:4 (1 1)
Image Size                      : 7776x2246
Megapixels                      : 17.5

ultramango commented 7 years ago

This is actually a bit tricky as the resulting image is different (has different properties). I guess some of the properties could be copied across (e.g. manufacturer).

See this link on how to copy EXIF data: http://thomer.com/howtos/copy_exif.html

I'll think about adding such an option.

ftoledo commented 7 years ago

I agree, exiftool do this job. What fields to copy can be from different vendors. But i think that copy camera model, (make and model), dates (createDate) and some photo status like (iso, flash, exposure time, etc) that can keep in the output file. thanks. ps: your script is very close to be great tool!, i want to avoid use the samsung software.

ultramango commented 7 years ago

I'd say that basic stuff could be copied. I could have look at the file produced by the S7 or ActionDirector to see what's in them as a reference (don't have access to those now as I "lost" my Gear360 somewhere).

Thanks, it's definitely far from perfect, I plan to do small improvements as I find time to do it.

ftoledo commented 7 years ago

I test and the only tag that need facebook to get as 360 photo is projectiontype i use exiftool:

exiftool -Projectiontype=equirectangular <photo_pano.jpg>

and facebook understand that the uploaded photo is 360. =)

ultramango commented 7 years ago

EXIF data is now copied except some lens data (plus thumbnails I think).

ftoledo commented 7 years ago

thanks!!!