Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 135 lines (98 sloc) 4.606 kb
b09eea4 Rests of class access removed, renaming Exiftool --> MiniExiftool, RE…
Jan Friedrich authored
1 = MiniExiftool
2
caeed2b Documention supplemented
Jan Friedrich authored
3 This library is wrapper for the Exiftool command-line application
81e8bbd Some improvements of the documentation.
Jan Friedrich authored
4 (http://www.sno.phy.queensu.ca/~phil/exiftool) written by Phil Harvey.
a43e647 Some texts changed.
Jan Friedrich authored
5 Read and write access is done in a clean OO manner.
b09eea4 Rests of class access removed, renaming Exiftool --> MiniExiftool, RE…
Jan Friedrich authored
6
caeed2b Documention supplemented
Jan Friedrich authored
7 == Requirements
8
0087d59 @janfri Preparing release 2.0.0.
authored
9 Ruby 1.9 or higher and an installation of the Exiftool
10 command-line application at least version 7.65.
11 If you run on Ruby 1.8 or with a prior exiftool version
12 install mini_exiftool version 1.x.x.
caeed2b Documention supplemented
Jan Friedrich authored
13 Instructions for installation you can find under
14 http://www.sno.phy.queensu.ca/~phil/exiftool/install.html .
15
5a17f35 @janfri Hint in README to mini_exiftool_vendored.
authored
16 Alternatively Wil Gieseler has bundled a meta-gem that eliminates the
2a0e409 @janfri Fix typos.
authored
17 need for a separate Exiftool installation. Have a look at
a4eb504 @janfri Fix URI in README.
authored
18 http://github.com/wilg/mini_exiftool_vendored or
5a17f35 @janfri Hint in README to mini_exiftool_vendored.
authored
19 http://rubygems.org/gems/mini_exiftool_vendored .
20
330ff17 README, Changelog and Tutorial updated.
Jan Friedrich authored
21 == Installation
22
81e8bbd Some improvements of the documentation.
Jan Friedrich authored
23 First you need Exiftool (see under Requirements above). Then you can simply
24 install the gem with
330ff17 README, Changelog and Tutorial updated.
Jan Friedrich authored
25 gem install mini_exiftool
26
499c155 @janfri Reorganizing README: Improved structure and focus on the essentials.
authored
27 If you need to support older versions of Ruby or exiftool (see Requirements above)
0087d59 @janfri Preparing release 2.0.0.
authored
28 gem install --version "< 2.0.0" mini_exiftool
29
80bfe30 @janfri Added configuration section to README.
authored
30 == Configuration
31
32 You can manually set the exiftool command that should be used via
33 MiniExiftool.command = '/path/to/my/exiftool'
34
35 In addition, you can also tell MiniExiftool where to store the PStore files with tags
36 which exiftool supports. The PStore files are used for performance issues.
37 Per default the PStore files are stored in a sub directory .mini_exiftool or
38 _mini_exiftool under your home directory.
39 MiniExiftool.pstore_dir = '/path/to/pstore/dir'
40
41 If you're using Rails, this is easily done with
42 MiniExiftool.pstore_dir = Rails.root.join('tmp').to_s
43
44 Important hint: if you have to change the configuration you have to do this direct
45 after require 'mini_exiftool'.
46
499c155 @janfri Reorganizing README: Improved structure and focus on the essentials.
authored
47 == Usage
48
49 In general MiniExiftool is very intuitive to use as the following examples show:
50
51 # Reading meta data
52 photo = MiniExiftool.new 'photo.jpg'
53 puts photo.title
54
55 # Writing meta data
56 photo = MiniExiftool.new 'photo.jpg'
57 photo.title = 'This is the new title'
58 photo.save
59
3a8bca1 @janfri Update documentation and new example for copying meta data.
authored
60 # Copying meta data
61 photo = MiniExiftool.new('photo.jpg')
62 photo.copy_tags_from('another_photo.jpg', :author)
63
64
499c155 @janfri Reorganizing README: Improved structure and focus on the essentials.
authored
65 For further information about using MiniExiftool read the Tutorial.rdoc
66 in the project root folder and have a look at the examples in directory
67 examples.
81e8bbd Some improvements of the documentation.
Jan Friedrich authored
68
f1d3f10 @janfri Add section about encodings in README.md.
authored
69 == Encodings
70
71 In MiniExiftool all strings are encoded in UTF-8. If you need other
72 encodings in your project use the String#encod* methods.
73
74 If you have problems with corrupted strings when using MiniExiftool
75 there are two reasons for this:
76
77 === Internal character sets
78
79 You can specify the charset in which the meta data is in the file encoded
80 if you read or write to some sections of meta data (i.e. IPTC, XMP ...).
81 It exists various options of the form *_encoding: exif, iptc, xmp, png,
82 id3, pdf, photoshop, quicktime, aiff, mie and vorbis.
83
25dc45f @janfri Extend section about encodings in README.md.
authored
84 For IPTC meta data it is recommended to set also the CodedCharacterSet
85 tag.
86
f1d3f10 @janfri Add section about encodings in README.md.
authored
87 Please read the section about the character sets of the ExifTool command
88 line application carefully to understand what's going on
89 (http://www.sno.phy.queensu.ca/~phil/exiftool/faq.html#Q10)!
90
25dc45f @janfri Extend section about encodings in README.md.
authored
91 # Using UTF-8 as internal encoding for IPTC tags and MacRoman
92 # as internal encoding for EXIF tags
93 photo = MiniExiftool.new('photo.jpg', iptc_encoding: 'UTF8',
94 exif_encoding: 'MacRoman'
95 # IPTC CaptionAbstract is already UTF-8 encoded
96 puts photo.caption_abstract
97 # EXIF Comment is converted from MacRoman to UTF-8
98 puts photo.comment
99
100 photo = MiniExiftool.new('photo.jpg', iptc_encoding: 'UTF8',
101 exif_encoding: 'MacRoman'
102 # When saving IPTC data setting CodedCharacterSet as recommended
103 photo.coded_character_set = 'UTF8'
104 # IPTC CaptionAbstract will be stored in UTF-8 encoding
105 photo.caption_abstract = 'Some text with Ümläuts'
106 # EXIF Comment will be stored in MacRoman encoding
107 photo.comment = 'Comment with Ümläuts'
108 photo.save
f1d3f10 @janfri Add section about encodings in README.md.
authored
109
110 === Corrupt characters
111
112 You use the correct internal character set but in the string are still corrupt
113 characters.
114 This problem you can solve with the option replace_invalid_chars:
115
116 # Replace all invalid characters with a question mark
117 photo = MiniExiftool.new('photo.jpg', replace_invalid_chars: '?')
118
81e8bbd Some improvements of the documentation.
Jan Friedrich authored
119 == Contribution
120
2a0e409 @janfri Fix typos.
authored
121 The code is hosted in a git repository on Gitorious at
499c155 @janfri Reorganizing README: Improved structure and focus on the essentials.
authored
122 http://gitorious.org/mini_exiftool
0087d59 @janfri Preparing release 2.0.0.
authored
123 and github at
124 https://github.com/janfri/mini_exiftool
81e8bbd Some improvements of the documentation.
Jan Friedrich authored
125 feel free to contribute!
330ff17 README, Changelog and Tutorial updated.
Jan Friedrich authored
126
b09eea4 Rests of class access removed, renaming Exiftool --> MiniExiftool, RE…
Jan Friedrich authored
127 == Author
0087d59 @janfri Preparing release 2.0.0.
authored
128 Jan Friedrich <janfri26@gmail.com>
b09eea4 Rests of class access removed, renaming Exiftool --> MiniExiftool, RE…
Jan Friedrich authored
129
130 == Copyright / License
fcd0a21 @janfri Update year in README.
authored
131 Copyright (c) 2007-2014 by Jan Friedrich
b09eea4 Rests of class access removed, renaming Exiftool --> MiniExiftool, RE…
Jan Friedrich authored
132
a7bdffa @janfri Update documentation for using yard.
authored
133 Licensed under terms of the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1,
330ff17 README, Changelog and Tutorial updated.
Jan Friedrich authored
134 February 1999 (see file COPYING for more details)
Something went wrong with that request. Please try again.