This repository was archived by the owner on Jan 7, 2024. It is now read-only.
File tree 2 files changed +32
-4
lines changed
src/main/groovy/de/ploing/flickrdl
2 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,32 @@ document which will go public) and you want to give proper credits to images
15
15
licensed in the Creative Commons.
16
16
17
17
18
+ Requirements
19
+ ============
20
+
18
21
Compilation
19
- ===========
22
+ -----------
20
23
21
24
For compilation, you need a working gradle environment (get more information here: http://gradle.org/ ).
22
25
In order to create the standalone jar file, run
23
26
24
27
gradle dist
25
28
26
29
30
+ External programs
31
+ -----------------
32
+
33
+ flickrdl is able to embed the images' metadata in the EXIF/IPTC section of the image.
34
+ This is done by calling one of the following external tools:
35
+
36
+ * exiftool http://www.sno.phy.queensu.ca/~phil/exiftool/
37
+ * exiv2 http://www.exiv2.org/
38
+
39
+ If one of these two programs is found in the current PATH, it will be used automatically.
40
+ If none of them is installed, the only possibility to store the metadata is the creation
41
+ of a sidecar file.
42
+
43
+
27
44
Usage
28
45
=====
29
46
Original file line number Diff line number Diff line change @@ -92,14 +92,25 @@ class FlickrDL {
92
92
photo. getTags(). each { t ->
93
93
cmd + = [ " -Keywords+=${ t.getValue()} " ]
94
94
}
95
- cmd + = [ imageFilename ]
95
+ cmd + = [ ' -overwrite_original_in_place ' , imageFilename ]
96
96
def proc = cmd. execute()
97
97
proc. waitFor()
98
98
}
99
99
100
100
static addMetadataWithExiv2 (photo , imageFilename , path ) {
101
- println " Adding metadata to ${ imageFilename} with exiv2 ${ path} "
102
-
101
+ def cmd = [ path,
102
+ " -Mset Exif.Image.Artist String ${ photo.getOwner().getRealName()?:photo.getOwner().getUsername()} " ,
103
+ " -Mset Exif.Photo.UserComment String License: ${ licenses.get(photo.getLicense())} Source: ${ photo.getUrl()} " ,
104
+ " -Mset Iptc.Application2.Byline String ${ photo.getOwner().getRealName()?:photo.getOwner().getUsername()} " ,
105
+ " -Mset Iptc.Application2.Contact String ${ photo.getUrl()} " ,
106
+ " -Mset Iptc.Application2.Copyright String ${ licenses.get(photo.getLicense())} "
107
+ ]
108
+ photo. getTags(). each { t ->
109
+ cmd + = [ " -Madd Iptc.Application2.Keywords String ${ t.getValue()} " ]
110
+ }
111
+ cmd + = [ imageFilename ]
112
+ def proc = cmd. execute()
113
+ proc. waitFor()
103
114
}
104
115
105
116
static main (args ) {
You can’t perform that action at this time.
0 commit comments