Skip to content

Commit a80cf2b

Browse files
authored
Merge pull request #166 from tlnagy/tn/fix-norm-tiff-loader
prevent OMETIFF from hijacking TIFF saving
2 parents 2886a42 + 3a707a0 commit a80cf2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/registry.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ function detecttiff(io)
186186
# do any of the first 4 bytes match any of the 4 possible combinations of tiff magics
187187
return any(map(x->all(magic .== x), tiff_magic))
188188
end
189-
# OME-TIFF
190-
detect_ometiff(io) = detecttiff(io) && (endswith(io.name, ".ome.tif>") || endswith(io.name, ".ome.tiff>"))
191-
add_format(format"OMETIFF", detect_ometiff, [".tif", ".tiff"], [:OMETIFF])
192189
# normal TIFF
193190
detect_noometiff(io) = detecttiff(io) && !(endswith(io.name, ".ome.tif>") || endswith(io.name, ".ome.tiff>"))
194191
add_format(format"TIFF", detect_noometiff, [".tiff", ".tif"], [:QuartzImageIO, OSX], [:ImageMagick])
192+
# OME-TIFF
193+
detect_ometiff(io) = detecttiff(io) && (endswith(io.name, ".ome.tif>") || endswith(io.name, ".ome.tiff>"))
194+
add_format(format"OMETIFF", detect_ometiff, [".tif", ".tiff"], [:OMETIFF])
195195

196196
# custom skipmagic functions for function-based tiff magic detection
197197
skipmagic(io, ::typeof(detect_ometiff)) = seek(io, 4)

0 commit comments

Comments
 (0)