Tuesday, May 31, 2016

EXIF info

General knowledge
http://www.media.mit.edu/pia/Research/deepview/exif.html


Two utilities.

exiftool: Perl
http://www.sno.phy.queensu.ca/~phil/exiftool/

exiv2: C++

http://www.exiv2.org/

exiftool is better than exiv2 in terms of extracting more information. 

For a sample GPS.JPG,


exiv2 output
~/exiv2-0.25/bin$ ./exiv2 GPS.jpg
File name       : GPS.jpg
File size       : 2133 Bytes
MIME type       : image/jpeg
Image size      : 120 x 80
Camera make     : FUJIFILM
Camera model    : FinePixS1Pro
Image timestamp : 2002:07:13 15:58:28
Image number    :
Exposure time   : 1/724 s
Aperture        : F0.64
Exposure bias   : -1090519041/1677721600 EV
Flash           : No flash
Flash bias      :
Focal length    : 0.0 mm
Subject distance:
ISO speed       :
Exposure mode   : Shutter priority
Metering mode   : Multi-segment
Macro mode      :
Image quality   :
Exif Resolution : 2400 x 1600
White balance   :
Thumbnail       : image/jpeg, 28 Bytes
Copyright       : ian Britton - FreeFoto.com
Exif comment    :

exiftool output
~/exiv2-0.25/bin$ ./exiv2 GPS.jpg
File name       : GPS.jpg
File size       : 2133 Bytes
MIME type       : image/jpeg
Image size      : 120 x 80
Camera make     : FUJIFILM
Camera model    : FinePixS1Pro
Image timestamp : 2002:07:13 15:58:28
Image number    :
Exposure time   : 1/724 s
Aperture        : F0.64
Exposure bias   : -1090519041/1677721600 EV
Flash           : No flash
Flash bias      :
Focal length    : 0.0 mm
Subject distance:
ISO speed       :
Exposure mode   : Shutter priority
Metering mode   : Multi-segment
Macro mode      :
Image quality   :
Exif Resolution : 2400 x 1600
White balance   :
Thumbnail       : image/jpeg, 28 Bytes
Copyright       : ian Britton - FreeFoto.com
Exif comment    :


EXIF tags:
http://www.exiv2.org/tags.html


Write comments
Both can read/write comments.
./exiv2 -M"set Exif.Photo.UserComment charset=Ascii testtest" test.jpg

============
http://stackoverflow.com/questions/8937963/save-custom-metadata-in-an-image-taken-from-avfoundation-in-ios

Saturday, May 14, 2016

CALayer

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CALayer_class/

alpha:
Simply change opacity directly. The range is within [0.0f, 1.0f]
http://stackoverflow.com/questions/15865500/calayer-sublayer-alpha-overriding

http://stackoverflow.com/questions/12448847/calayer-opacity-animation

rounded corner:
Can be changed on the fly through "setCornerRadiu"
http://stackoverflow.com/questions/4754392/uiview-with-rounded-corners-and-drop-shadow

frame:
Can be changed on the fly by writing to frame directly

contentsGravity vs contentsScale vs transform/affineTransform

contentsScale: 1 => 1 pixel per point, n=> n pixels per point
- when kCAGravityResizeAspect / kCAGravityCenter

If out of bound, masksToBounds property is useful.

contentsRect: 0-1.0.  unit coordinates.
- sprite sheets:

contentsCenter: area can be stretched.