Skip to content

Commit

Permalink
0.4 Dict syntax change: prevent errors. Still need to fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Oct 8, 2014
1 parent 56ab1c4 commit 4c2c153
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ spatialproperties(img::AbstractVector) = ASCIIString[] # these are not mutable
function permutation(to, from)
n = length(to)
nf = length(from)
d = Dict(tuple(from...), tuple([1:length(from)]...))
d = Dict([(from[i], i) for i = 1:length(from)])
ind = Array(Int, max(n, nf))
for i = 1:n
ind[i] = get(d, to[i], 0)
Expand Down
4 changes: 2 additions & 2 deletions src/ioformats/libmagickwand.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ const DefaultChannels = ChannelType( (AllChannels.value | SyncChannels.value) &~

# Image type
const IMType = ["BilevelType", "GrayscaleType", "GrayscaleMatteType", "PaletteType", "PaletteMatteType", "TrueColorType", "TrueColorMatteType", "ColorSeparationType", "ColorSeparationMatteType", "OptimizeType", "PaletteBilevelMatteType"]
const IMTypedict = Dict(IMType, 1:length(IMType))
const IMTypedict = Dict([(IMType[i], i) for i = 1:length(IMType)])

const CStoIMTypedict = ["Gray" => "GrayscaleType", "GrayAlpha" => "GrayscaleMatteType", "RGB" => "TrueColorType", "ARGB" => "TrueColorMatteType", "CMYK" => "ColorSeparationType"]

# Colorspace
const IMColorspace = ["RGB", "Gray", "Transparent", "OHTA", "Lab", "XYZ", "YCbCr", "YCC", "YIQ", "YPbPr", "YUV", "CMYK", "sRGB"]
const IMColordict = Dict(IMColorspace, 1:length(IMColorspace))
const IMColordict = Dict([(IMColorspace[i], i) for i = 1:length(IMColorspace)])

function nchannels(imtype::String, cs::String, havealpha = false)
n = 3
Expand Down

0 comments on commit 4c2c153

Please sign in to comment.