Skip to content

Commit

Permalink
Merge pull request #50 from cormullion/fixwarn
Browse files Browse the repository at this point in the history
replace warn with @warn
  • Loading branch information
SimonDanisch authored Oct 27, 2018
2 parents 253b489 + d2455cc commit 17dc725
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/QuartzImageIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ end
## core, internal function
function read_and_release_imgsrc(imgsrc)
if imgsrc == C_NULL
warn("QuartzImageIO created no image source")
@warn "QuartzImageIO created no image source"
return nothing
end
# Get image information
imframes = convert(Int, CGImageSourceGetCount(imgsrc))
if imframes == 0
# Bail out to ImageMagick
warn("QuartzImageIO found no frames")
@warn "QuartzImageIO found no frames"
CFRelease(imgsrc)
return nothing
end
Expand All @@ -62,7 +62,7 @@ function read_and_release_imgsrc(imgsrc)
isindexed = CFBooleanGetValue(CFDictionaryGetValue(dict, "IsIndexed"))
if isindexed
# Bail out to ImageMagick
warn("QuartzImageIO: indexed color images not implemented")
@warn "QuartzImageIO: indexed color images not implemented"
CFRelease(imgsrc)
return nothing
end
Expand All @@ -73,7 +73,7 @@ function read_and_release_imgsrc(imgsrc)
colormodel = CFStringGetCString(CFDictionaryGetValue(dict, "ColorModel"))
if colormodel == ""
# Bail out to ImageMagick
warn("QuartzImageIO found empty colormodel string")
@warn "QuartzImageIO found empty colormodel string"
CFRelease(imgsrc)
return nothing
end
Expand Down Expand Up @@ -119,7 +119,7 @@ function read_and_release_imgsrc(imgsrc)
buf = alphacode == 5 ? Array{RGB4{T}}(undef, sz) : Array{RGB1{T}}(undef, sz)
fillcolor!(reshape(reinterpret(T, buf), (4, sz...)), imgsrc, storagedepth)
else
warn("Unknown colormodel ($colormodel) and alphacode ($alphacode) found by QuartzImageIO")
@warn "Unknown colormodel ($colormodel) and alphacode ($alphacode) found by QuartzImageIO"
CFRelease(imgsrc)
return nothing
end
Expand Down Expand Up @@ -225,9 +225,9 @@ function save_(f::File{R}, img::AbstractArray;
try
imgm = map(x -> mapCG(mapi(x)), img)
catch
warn("""QuartzImageIO: Mapping to the storage type failed.
@warn """QuartzImageIO: Mapping to the storage type failed.
Perhaps your data had out-of-range values?
Try `map(clamp01nan, img)` to clamp values to a valid range.""")
Try `map(clamp01nan, img)` to clamp values to a valid range."""
rethrow()
end
permute_horizontal && (imgm = permutedims_horizontal(imgm))
Expand Down

0 comments on commit 17dc725

Please sign in to comment.