rharder / imagesnap

Capture Images from the Command Line
https://github.com/rharder/imagesnap
458 stars 50 forks source link

added datecreated and datetimeoriginal exif data for jpg type .. needs c... #5

Closed jacobrosenthal closed 3 years ago

jacobrosenthal commented 11 years ago

...hecking for memory managment as was original built with arc

Needed to switch from NSbitmapimageref to CGImageSourceRef in order to allow exif data dictionaries.

Please do take a look at it with an experienced eye for memory management. I built mine on arc and just pasted it over without the _bridges

jacobrosenthal commented 11 years ago

Before

ExifTool Version Number : 9.03 File Name : 2013-08-20 05:26:20 -0400.jpg Directory : /Users/jacobrosenthal/Pictures/memoryIO File Size : 379 kB File Modification Date/Time : 2013:08:20 05:26:23-04:00 File Access Date/Time : 2013:08:25 05:02:44-04:00 File Permissions : rw-r--r-- File Type : JPEG MIME Type : image/jpeg JFIF Version : 1.01 Resolution Unit : None X Resolution : 1 Y Resolution : 1 Profile CMM Type : Lino Profile Version : 2.1.0 Profile Class : Display Device Profile Color Space Data : RGB Profile Connection Space : XYZ Profile Date Time : 1998:02:09 06:49:00 Profile File Signature : acsp Primary Platform : Microsoft Corporation CMM Flags : Not Embedded, Independent Device Manufacturer : IEC Device Model : sRGB Device Attributes : Reflective, Glossy, Positive, Color Rendering Intent : Perceptual Connection Space Illuminant : 0.9642 1 0.82491 Profile Creator : HP Profile ID : 0 Profile Copyright : Copyright (c) 1998 Hewlett-Packard Company Profile Description : sRGB IEC61966-2.1 Media White Point : 0.95045 1 1.08905 Media Black Point : 0 0 0 Red Matrix Column : 0.43607 0.22249 0.01392 Green Matrix Column : 0.38515 0.71687 0.09708 Blue Matrix Column : 0.14307 0.06061 0.7141 Device Mfg Desc : IEC http://www.iec.ch Device Model Desc : IEC 61966-2.1 Default RGB colour space - sRGB Viewing Cond Desc : Reference Viewing Condition in IEC61966-2.1 Viewing Cond Illuminant : 19.6445 20.3718 16.8089 Viewing Cond Surround : 3.92889 4.07439 3.36179 Viewing Cond Illuminant Type : D50 Luminance : 76.03647 80 87.12462 Measurement Observer : CIE 1931 Measurement Backing : 0 0 0 Measurement Geometry : Unknown (0) Measurement Flare : 0.999% Measurement Illuminant : D65 Technology : Cathode Ray Tube Display Red Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Green Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Blue Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Exif Byte Order : Big-endian (Motorola, MM) Color Space : sRGB Exif Image Width : 1280 Exif Image Height : 720 Image Width : 1280 Image Height : 720 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2) Image Size : 1280x720

and after

ExifTool Version Number : 9.03 File Name : 2013-08-2504:57:07-0400.jpg Directory : /Users/jacobrosenthal/Pictures/memoryIO File Size : 311 kB File Modification Date/Time : 2013:08:25 04:57:07-04:00 File Access Date/Time : 2013:08:25 04:57:08-04:00 File Permissions : rw-r--r-- File Type : JPEG MIME Type : image/jpeg JFIF Version : 1.01 Resolution Unit : None X Resolution : 1 Y Resolution : 1 Profile CMM Type : Lino Profile Version : 2.1.0 Profile Class : Display Device Profile Color Space Data : RGB Profile Connection Space : XYZ Profile Date Time : 1998:02:09 06:49:00 Profile File Signature : acsp Primary Platform : Microsoft Corporation CMM Flags : Not Embedded, Independent Device Manufacturer : IEC Device Model : sRGB Device Attributes : Reflective, Glossy, Positive, Color Rendering Intent : Perceptual Connection Space Illuminant : 0.9642 1 0.82491 Profile Creator : HP Profile ID : 0 Profile Copyright : Copyright (c) 1998 Hewlett-Packard Company Profile Description : sRGB IEC61966-2.1 Media White Point : 0.95045 1 1.08905 Media Black Point : 0 0 0 Red Matrix Column : 0.43607 0.22249 0.01392 Green Matrix Column : 0.38515 0.71687 0.09708 Blue Matrix Column : 0.14307 0.06061 0.7141 Device Mfg Desc : IEC http://www.iec.ch Device Model Desc : IEC 61966-2.1 Default RGB colour space - sRGB Viewing Cond Desc : Reference Viewing Condition in IEC61966-2.1 Viewing Cond Illuminant : 19.6445 20.3718 16.8089 Viewing Cond Surround : 3.92889 4.07439 3.36179 Viewing Cond Illuminant Type : D50 Luminance : 76.03647 80 87.12462 Measurement Observer : CIE 1931 Measurement Backing : 0 0 0 Measurement Geometry : Unknown (0) Measurement Flare : 0.999% Measurement Illuminant : D65 Technology : Cathode Ray Tube Display Red Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Green Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Blue Tone Reproduction Curve : (Binary data 2060 bytes, use -b option to extract) Exif Byte Order : Big-endian (Motorola, MM) Photometric Interpretation : RGB Orientation : Horizontal (normal) Date/Time Original : 2013-08-25 04:57:07 -0400 Create Date : 2013-08-25 04:57:07 -0400 Color Space : sRGB Exif Image Width : 1280 Exif Image Height : 720 Image Width : 1280 Image Height : 720 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2) Image Size : 1280x720

Noreaster76 commented 6 years ago

@jacobrosenthal Kind of an old pull request, but if you're still interested in making this happen, there are some merge conflicts.

rharder commented 3 years ago

I think this merge request can be dropped -- too much of the underlying Apple frameworks have changed, but the idea is sound if someone wants to re-investigate it.

rharder commented 3 years ago

I think this merge request can be dropped -- too much of the underlying Apple frameworks have changed, but the idea is sound if someone wants to re-investigate it.