Skip to content

Commit cefcc80

Browse files
Added doc strings to magickinfo. (#194)
1 parent b245c65 commit cefcc80

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

src/ImageMagick.jl

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,69 @@ end
213213

214214
formatstring(s::Stream{DataFormat{S}}) where {S} = string(S)
215215

216+
@doc raw"""
217+
magickinfo(file::Union{AbstractString,IO})
218+
219+
Reads an image `file` and returns an array of strings describing the property data in the image file.
220+
221+
# Examples
222+
```julia-repl
223+
julia> p = magickinfo("Image.jpeg")
224+
63-element Array{String,1}:
225+
"date:create"
226+
"date:modify"
227+
"exif:ApertureValue"
228+
"exif:BrightnessValue"
229+
"exif:ColorSpace"
230+
"exif:ComponentsConfiguration"
231+
"exif:DateTime"
232+
"exif:DateTimeDigitized"
233+
"exif:DateTimeOriginal"
234+
"exif:ExifImageLength"
235+
"exif:ExifImageWidth"
236+
"exif:ExifOffset"
237+
"exif:ExifVersion"
238+
239+
"exif:thumbnail:JPEGInterchangeFormat"
240+
"exif:thumbnail:JPEGInterchangeFormatLength"
241+
"exif:thumbnail:ResolutionUnit"
242+
"exif:thumbnail:XResolution"
243+
"exif:thumbnail:YResolution"
244+
"exif:WhiteBalance"
245+
"exif:XResolution"
246+
"exif:YCbCrPositioning"
247+
"exif:YResolution"
248+
"jpeg:colorspace"
249+
"jpeg:sampling-factor"
250+
"unknown"a
251+
```
252+
"""
216253
function magickinfo(file::Union{AbstractString,IO})
217254
wand = MagickWand()
218255
readimage(wand, file)
219256
resetiterator(wand)
220257
getimageproperties(wand, "*")
221258
end
222259

260+
@doc raw"""
261+
magickinfo(file::Union{AbstractString,IO}, properties::Union{Tuple,AbstractVector})
262+
263+
Reads an image `file` and returns a Dict containing the values for the requested `properties`.
264+
265+
# Examples
266+
```julia-repl
267+
julia> magickinfo("IMG_6477.jpeg",
268+
("exif:DateTime","exif:GPSLatitude","exif:GPSLatitudeRef",
269+
"exif:GPSLongitude","exif:GPSLongitudeRef","exif:GPSAltitude"))
270+
Dict{String,Any} with 6 entries:
271+
"exif:GPSLongitudeRef" => "W"
272+
"exif:GPSLatitude" => "44/1, 22/1, 2326/100"
273+
"exif:GPSLatitudeRef" => "N"
274+
"exif:GPSLongitude" => "71/1, 13/1, 5301/100"
275+
"exif:DateTime" => "2020:01:22 13:17:41"
276+
"exif:GPSAltitude" => "261189/757"
277+
```
278+
"""
223279
function magickinfo(file::Union{AbstractString,IO}, properties::Union{Tuple,AbstractVector})
224280
wand = MagickWand()
225281
readimage(wand, file)

0 commit comments

Comments
 (0)