Giter Club home page Giter Club logo

quartzimageio.jl's Introduction

NOTE

This package is not maintained and will likely be broken in the future.

Most commonly used image formats are supported by ImageIO.jl now, and for others, ImageMagick.jl has good coverage.

QuartzImageIO

CI Code coverage

This package provides support for loading and saving images using native libraries on macOS. This package was split off from Images.jl to make image I/O more modular.

Installation

Add the package with

Pkg.add("QuartzImageIO")

Usage

QuartzImageIO will be used as needed if you've said

using FileIO

in your session or module. You should not generally say using QuartzImageIO. See FileIO for further details.

It's worth pointing out that packages such as Images load FileIO.

Alternatives

If QuartzImageIO does not provide the functionality you need, an alternative is ImageMagick and ImageIO. You can have both packages installed, and FileIO will manage their interaction.

quartzimageio.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quartzimageio.jl's Issues

Register more input formats

This code lets us see what's available

julia> CFShow(CFTypeRef::Ptr{Void}) = CFTypeRef != C_NULL && ccall(:CFShow, Void, (Ptr{Void}, ), CFTypeRef)
CFShow (generic function with 1 method)

julia> imgsources = ccall((:CGImageSourceCopyTypeIdentifiers, "ImageIO.framework/ImageIO"),
                    Ptr{Void}, ())
Ptr{Void} @0x00007fda7b0c0c60

julia> CFShow(imgsources)
(
    "public.jpeg",
    "public.png",
    "com.compuserve.gif",
    "public.jpeg-2000",
    "com.canon.tif-raw-image",
    "com.adobe.raw-image",
    "com.dxo.raw-image",
    "com.canon.cr2-raw-image",
    "com.leafamerica.raw-image",
    "com.hasselblad.fff-raw-image",
    "com.hasselblad.3fr-raw-image",
    "com.nikon.raw-image",
    "com.nikon.nrw-raw-image",
    "com.pentax.raw-image",
    "com.samsung.raw-image",
    "com.sony.raw-image",
    "com.sony.sr2-raw-image",
    "com.sony.arw-raw-image",
    "com.epson.raw-image",
    "com.kodak.raw-image",
    "public.tiff",
    "com.apple.icns",
    "com.canon.crw-raw-image",
    "com.fuji.raw-image",
    "com.panasonic.raw-image",
    "com.panasonic.rw2-raw-image",
    "com.leica.raw-image",
    "com.leica.rwl-raw-image",
    "com.konicaminolta.raw-image",
    "com.olympus.sr-raw-image",
    "com.olympus.or-raw-image",
    "com.olympus.raw-image",
    "com.adobe.photoshop-image",
    "com.microsoft.ico",
    "com.microsoft.bmp",
    "com.microsoft.cur",
    "com.truevision.tga-image",
    "com.sgi.sgi-image",
    "com.apple.macpaint-image",
    "com.ilm.openexr-image",
    "public.radiance",
    "public.mpo-image",
    "public.pbm",
    "public.pvr",
    "com.apple.rjpeg",
    "com.apple.pict",
    "com.apple.quicktime-image",
    "com.kodak.flashpix-image"
)

Column first or Row first?

for the past few days I was working with ImageMagick.jl on my MacBook, but just yesterday I decided to try QuartzImageIO.jl again. While it works for me on master (but with Julia 0.5), I do get the Image in a different dimension order than I got it with image magick.

julia> img = testimage("lighthouse") # with ImageMagick.jl
512×768 Array{RGB4{N0f8},2}:
[...]

julia> img = testimage("lighthouse") # with QuartzImageIO.jl
768×512 Array{RGB4{N0f8},2}:
[...]

Is this a bug or a feature? I thought the idea was to go with the julia array layout unless Axis Arrays are used.

EDIT: maybe related to https://github.com/JuliaIO/QuartzImageIO.jl/blob/master/src/QuartzImageIO.jl#L119-L120 ?

Guidance on images-next

If anyone is interested in creating an images-next branch, the best model to follow would be my commit to ImageMagick: JuliaIO/ImageMagick.jl@348e9ac. From a brief scan of the code in this repo, aside from updating the tests it seems like it could be as simple as:

  • returning the plain array and skipping the Dict creation, just returning buf directly.
  • some small fixes for writemime

The "O" part

File output has been on my todo list for quite a while.

Available output formats are:

(
    "public.jpeg",
    "public.png",
    "com.compuserve.gif",
    "public.jpeg-2000",
    "public.tiff",
    "com.apple.icns",
    "com.adobe.photoshop-image",
    "com.adobe.pdf",
    "com.microsoft.ico",
    "com.microsoft.bmp",
    "com.truevision.tga-image",
    "com.sgi.sgi-image",
    "com.ilm.openexr-image",
    "public.pbm",
    "public.pvr",
    "com.apple.rjpeg"
)

FileIO.NotInstalledError(:QuartzImageIO,"")

Loading a PNG image gives me a warning and requests that I report the issue on GitHub.

julia> using FileIO
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/FileIO.ji for module FileIO.

julia> a = load("~/a.png")
WARNING: FileIO.NotInstalledError(:QuartzImageIO,"")
 in checked_import at /Users/ararslan/.julia/FileIO/src/loadsave.jl:12
 in load at /Users/ararslan/.julia/FileIO/src/loadsave.jl:79
 in load at /Users/ararslan/.julia/FileIO/src/loadsave.jl:42
Trying next loading library! Please report this issue on the Github page for QuartzImageIO
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/ImageMagick.ji for module ImageMagick.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/FixedPointNumbers.ji for module FixedPointNumbers.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/ColorTypes.ji for module ColorTypes.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/Images.ji for module Images.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/Colors.ji for module Colors.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/Reexport.ji for module Reexport.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/ColorVectorSpace.ji for module ColorVectorSpace.
INFO: Recompiling stale cache file /Users/ararslan/.julia/lib/v0.4/Graphics.ji for module Graphics.
WARNING: ErrorException("UnableToOpenBlob `~/a.png': No such file or directory @ error/blob.c/OpenBlob/2701")
 in error at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib
 in error at /Users/ararslan/.julia/ImageMagick/src/libmagickwand.jl:149
 in readimage at /Users/ararslan/.julia/ImageMagick/src/libmagickwand.jl:228
 in load_ at /Users/ararslan/.julia/ImageMagick/src/ImageMagick.jl:75
 in load at /Users/ararslan/.julia/ImageMagick/src/ImageMagick.jl:63
 in load at /Users/ararslan/.julia/FileIO/src/loadsave.jl:80
 in load at /Users/ararslan/.julia/FileIO/src/loadsave.jl:42
Library QuartzImageIO is not installed but can load format: FileIO.File{FileIO.DataFormat{:PNG}}("~/Desktop/omg.png")
should we install QuartzImageIO for you? (y/n):
y
INFO: Start installing QuartzImageIO...
INFO: Cloning cache of QuartzImageIO from git://github.com/JuliaIO/QuartzImageIO.jl.git
INFO: Installing QuartzImageIO v0.1.2
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of QuartzImageIO
INFO: Use `Pkg.update()` to get the latest versions of your packages

So... here I am. OS X 10.10 Yosemite, Julia 0.4.5. Let me know what other information you need. 😄

WARNING: UndefVarError(:save)

This was triggered on a call to save on Julia 0.4.2 on OS X 10.10.5. Now trying 0.4.3 to see if that fixes it... It didn't.

WARNING: UndefVarError(:save)
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:95
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:51
 in include at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
Trying next loading library! Please report this issue on the Github page for QuartzImageIO
WARNING: FileIO.NotInstalledError(:ImageMagick,"")
 in checked_import at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:12
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:94
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:51
 in include at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
ERROR: LoadError: UndefVarError: save not defined
 in checked_import at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:12
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:94
 in save at /Users/yurivish/.julia/v0.4/FileIO/src/loadsave.jl:51
 in include at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia.app/Contents/Resources/julia/lib/julia/sys.dylib
while loading /Users/yurivish/Dropbox/Public/Magic/v4/code/main.jl, in expression starting on line 9

julia> Pkg.add("QuartzImageIO")
INFO: Nothing to be done

Need to import QuartzImageIO, otherwise errors

Using https://github.com/JuliaImages/TestImages.jl, if I don't manually import in QuartzImageIO into my own project/module, I get the following weird errors, whether or not I have QuartzImageIO as a dependency of my own project. (Note it complains of Base not having QuartzImageIO as a dependency.)

WARNING: eval into closed module __toplevel__:
Expr(:import, Expr(:., :QuartzImageIO))
  ** incremental compilation may be fatally broken for this module **

┌ Warning: Package Base does not have QuartzImageIO in its dependencies:
│ - If you have Base checked out for development and have
│   added QuartzImageIO as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Base
└ Loading QuartzImageIO into Base from project dependency, future warnings for Base are suppressed.
WARNING: eval into closed module FileIO:
:QuartzImageIO = Expr(:ref, Expr(:., :Base, :(:loaded_modules)), Base.PkgId(uuid=Base.UUID(value=UInt128(0xdca85d43d64c5e678c65017450d5d020)), name="QuartzImageIO"))
  ** incremental compilation may be fatally broken for this module **

RGB1->XRGB and RGB4->RGBX deprecation

Edit:

Just noticed that this is already fixed. Sorry for the noise, it turns out that there're some version locks in Project.toml

(@v1.5) pkg> add QuartzImageIO@0.6.0
   Updating registry at `~/.julia/registries/General`
  Resolving package versions...
No Changes to `~/.julia/environments/v1.5/Project.toml`
No Changes to `~/.julia/environments/v1.5/Manifest.toml`

(@v1.5) pkg> add QuartzImageIO@0.7.1
  Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
  [53c48c17]  FixedPointNumbers v0.8.4  v0.7.1
  [dca85d43]  QuartzImageIO v0.6.0  v0.7.1
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [53c48c17]  FixedPointNumbers v0.8.4  v0.7.1
  [dca85d43]  QuartzImageIO v0.6.0  v0.7.1

Should be fixed in #66

JuliaIO ownership

@timholy, could you make me an owner on JuliaIO? I'm currently a member. I currently can't control some settings for this repo, such as the tag line that appears at the top. I assume that making me an owner will fix this.

I think the setting lies here: https://github.com/orgs/JuliaIO/people

Thanks!

Failing to precompile on Mac OS X

Whenever I use QuartzImageIO (for loading images), I get an error.

[ Info: Precompiling QuartzImageIO [dca85d43-d64c-5e67-8c65-017450d5d020]
ERROR: LoadError: UndefVarError: RGBX not defined
Stacktrace:
 [1] top-level scope at /Users/michielstock/.julia/packages/QuartzImageIO/eZqJD/src/QuartzImageIO.jl:353
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1105
 [4] include(::Module, ::String) at ./Base.jl:31
 [5] top-level scope at none:2
 [6] eval at ./boot.jl:330 [inlined]
 [7] eval(::Expr) at ./client.jl:425
 [8] top-level scope at ./none:3
in expression starting at /Users/michielstock/.julia/packages/QuartzImageIO/eZqJD/src/QuartzImageIO.jl:353
ERROR: Failed to precompile QuartzImageIO [dca85d43-d64c-5e67-8c65-017450d5d020] to /Users/michielstock/.julia/compiled/v1.3/QuartzImageIO/n8vDP_mZWSB.ji.
Stacktrace:
 [1] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283
 [2] _require(::Base.PkgId) at ./loading.jl:1024
 [3] require(::Base.PkgId) at ./loading.jl:922
 [4] require(::Module, ::Symbol) at ./loading.jl:917

Though it still loads the image, it goes really slowly. This problem also occurs for my students apparently, when there is something out of bounds in a recipe.

using QuartzImageIO fails on Julia 0.7

Possibly due to a dependency based on the error but using QuartzImageIO is what I wanted to do so I'm filing the issue here.

julia> using QuartzImageIO
┌ Warning: Deprecated syntax `type` at /Users/pat/.julia/packages/QuartzImageIO/bzoc/src/QuartzImageIO.jl:678.
│ Use `mutable struct` instead.
└ @ ~/.julia/packages/QuartzImageIO/bzoc/src/QuartzImageIO.jl:678
[ Info: Precompiling module QuartzImageIO
┌ Warning: Deprecated syntax `type` at /Users/pat/.julia/packages/QuartzImageIO/bzoc/src/QuartzImageIO.jl:678.
│ Use `mutable struct` instead.
└ @ ~/.julia/packages/QuartzImageIO/bzoc/src/QuartzImageIO.jl:678
WARNING: importing deprecated binding Base.fft into Images.
WARNING: importing deprecated binding Base.ifft into Images.
WARNING: could not import Base.linearindexing into Images
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(AbstractArray{T, 1}) where {T} in module AxisArrays at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:43 overwritten at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:47.
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(A<:AbstractArray{T, 1}) where {T, A<:AbstractArray{T, 1}} in module AxisArrays at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:47 overwritten at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:43.
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(AbstractArray{T, 1}) where {T} in module AxisArrays at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:43 overwritten at /Users/pat/.julia/packages/AxisArrays/uZ7J/src/categoricalvector.jl:47.
WARNING: importing deprecated binding Base.CartesianRange into ImageFiltering.
WARNING: Base.CartesianRange is deprecated, use CartesianIndices instead.
  likely near /Users/pat/.julia/packages/ImageFiltering/cNt7/src/utils.jl:31
WARNING: Base.CartesianRange is deprecated, use CartesianIndices instead.
  likely near /Users/pat/.julia/packages/ImageFiltering/cNt7/src/utils.jl:51
ERROR: LoadError: LoadError: TypeError: in apply_type, in Vararg count, expected Int64, got Type{CartesianIndex{0}}
Stacktrace:
 [1] top-level scope at none:0
 [2] include at ./boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1034
 [4] include at ./sysimg.jl:29 [inlined]
 [5] include(::String) at /Users/pat/.julia/packages/ImageFiltering/cNt7/src/ImageFiltering.jl:3
 [6] top-level scope at none:0
 [7] include at ./boot.jl:317 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1034
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope at none:0
 [11] eval at ./boot.jl:319 [inlined]
 [12] eval(::Expr) at ./client.jl:394
 [13] top-level scope at ./none:3 [inlined]
 [14] top-level scope at ./<missing>:0
in expression starting at /Users/pat/.julia/packages/ImageFiltering/cNt7/src/utils.jl:51
in expression starting at /Users/pat/.julia/packages/ImageFiltering/cNt7/src/ImageFiltering.jl:44
ERROR: LoadError: Failed to precompile ImageFiltering to /Users/pat/.julia/compiled/v0.7/ImageFiltering/MN5u.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:298 [inlined]
 [3] compilecache(::Base.PkgId) at ./loading.jl:1173
 [4] macro expansion at ./logging.jl:298 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:929
 [6] require(::Base.PkgId) at ./loading.jl:838
 [7] require(::Module, ::Symbol) at ./loading.jl:833
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1034
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] top-level scope at none:0
 [12] eval at ./boot.jl:319 [inlined]
 [13] eval(::Expr) at ./client.jl:394
 [14] top-level scope at ./none:3 [inlined]
 [15] top-level scope at ./<missing>:0
in expression starting at /Users/pat/.julia/packages/Images/HB5L/src/Images.jl:49
ERROR: LoadError: Failed to precompile Images to /Users/pat/.julia/compiled/v0.7/Images/H8Vx.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:298 [inlined]
 [3] compilecache(::Base.PkgId) at ./loading.jl:1173
 [4] macro expansion at ./logging.jl:298 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:929
 [6] require(::Base.PkgId) at ./loading.jl:838
 [7] require(::Module, ::Symbol) at ./loading.jl:833
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1034
 [10] include(::Module, ::String) at ./sysimg.jl:29
 [11] top-level scope at none:0
 [12] eval at ./boot.jl:319 [inlined]
 [13] eval(::Expr) at ./client.jl:394
 [14] top-level scope at ./none:3 [inlined]
 [15] top-level scope at ./<missing>:0
in expression starting at /Users/pat/.julia/packages/QuartzImageIO/bzoc/src/QuartzImageIO.jl:4
ERROR: Failed to precompile QuartzImageIO to /Users/pat/.julia/compiled/v0.7/QuartzImageIO/n8vD.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:298 [inlined]
 [3] compilecache(::Base.PkgId) at ./loading.jl:1173
 [4] _require(::Base.PkgId) at ./loading.jl:942
 [5] require(::Base.PkgId) at ./loading.jl:838
 [6] require(::Module, ::Symbol) at ./loading.jl:833

julia> versioninfo()
Julia Version 0.7.0-beta2.6
Commit faee1df893* (2018-07-14 20:16 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)

Failure to save image, and WARNING: ErrorException("C call returned NULL")

I'm trying to save a PNG image file:

using Images, Colors, FixedPointNumbers
outdata = zeros(RGB{UFixed8}, 300, 300)
out = Image(outdata)
save("~/Desktop/out.png", out)

I tried removing my copy of imagemagick and reinstalling it through the package manager, and also tried checking out fresh versions of QuartzImageIO and FileIO but the final line still causes the following error on a fresh install of Julia 0.5.5 on OS X:

WARNING: ErrorException("C call returned NULL")
 in check_null at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:557 [inlined]
 in CGImageDestinationCreateWithURL(::Ptr{Void}, ::String, ::Int64, ::Ptr{Void}) at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:567
 in save_and_release(::Ptr{Void}, ::String, ::String) at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:239
 in save_(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::String) at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:268
 in #save#15(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:45
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:45
 in #save#18(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:97
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:91
 in #save#14(::Array{Any,1}, ::Function, ::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in save(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:266
 in _start() at ./client.jl:322
Trying next loading library! Please report this issue on the Github page for QuartzImageIO
WARNING: bytestring(p::Union{Ptr{Int8},Ptr{UInt8}}) is deprecated, use unsafe_string(p) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in bytestring(::Ptr{UInt8}) at ./deprecated.jl:50
 in error(::ImageMagick.MagickWand) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:150
 in writeimage(::ImageMagick.MagickWand, ::String) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:249
 in save_(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:158
 in #save#5(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in #save#18(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:97
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:91
 in #save#14(::Array{Any,1}, ::Function, ::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in save(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:266
 in _start() at ./client.jl:322
while loading /Users/yurivish/Dropbox/packing.jl, in expression starting on line 91
WARNING: ErrorException("no encode delegate for this image format `MIFF' @ error/constitute.c/WriteImage/1167")
 in error(::ImageMagick.MagickWand) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:152
 in writeimage(::ImageMagick.MagickWand, ::String) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:249
 in save_(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:158
 in #save#5(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in #save#18(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:97
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:91
 in #save#14(::Array{Any,1}, ::Function, ::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in save(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:266
 in _start() at ./client.jl:322
ERROR: LoadError: C call returned NULL
 in error(::ImageMagick.MagickWand) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:152
 in writeimage(::ImageMagick.MagickWand, ::String) at /Users/yurivish/.julia/v0.5/ImageMagick/src/libmagickwand.jl:249
 in save_(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:158
 in #save#5(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/ImageMagick/src/ImageMagick.jl:68
 in #save#18(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:97
 in save(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:91
 in #save#14(::Array{Any,1}, ::Function, ::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}, ::Vararg{Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}},N}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in save(::String, ::Images.Image{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}}) at /Users/yurivish/.julia/v0.5/FileIO/src/loadsave.jl:54
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:266
 in _start() at ./client.jl:322
while loading /Users/yurivish/Dropbox/packing.jl, in expression starting on line 91
[Finished in 3.6s with exit code 1]

versioninfo:

Julia Version 0.5.0-dev+4923
Commit 26fec34* (2016-06-23 21:09 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

(When trying to load TIFF files): WARNING: QuartzImageIO created no image source

I recently installed QuartzImageIO and now get the warning message above when trying to load .tiff images. The problem does not occur for JPGs or PNGs.

i.e.

using Images

load("image.tiff")
or
Images.load("images.tiff")

wont return a value and will give the warning: WARNING: QuartzImageIO created no image source

data(load("image.tiff")

returns:

MethodError: no method matching data(::Void)
Closest candidates are:
data(!Matched::ImageMetadata.ImageMeta{T,N,A<:AbstractArray}) at /Users/tomer/.julia/v0.5/ImageMetadata/src/ImageMetadata.jl:198
data(!Matched::AbstractArray{T,N}) at /Users/tomer/.julia/v0.5/ImageCore/src/deprecated.jl:88
in include_string(::String, ::String) at loading.jl:441
in include_string(::String, ::String, ::Int64) at eval.jl:28
in include_string(::Module, ::String, ::String, ::Int64, ::Vararg{Int64,N}) at eval.jl:32
in (::Atom.##53#56{String,Int64,String})() at eval.jl:40
in withpath(::Atom.##53#56{String,Int64,String}, ::String) at utils.jl:30
in withpath(::Function, ::String) at eval.jl:46
in macro expansion at eval.jl:57 [inlined]
in (::Atom.##52#55{Dict{String,Any}})() at task.jl:60

ARGB isn't saved correctly

Redirecting JuliaImages/ImageShow.jl#24 here.
It appears that save_ is first converting the input ARGB image to an RGBA image. The RGBA image bytes are used to create the CGBitmap, but the original ARGB channel ordering enumeration is passed in to CGBitmapContextCreate, so for example, red becomes blue.
It's not clear to me if the mapping from from ARGB to RGBA was intentional, ie, is the bug that it's mapped or that the wrong label is applied to the written data; it means save/load roundtrips wouldn't get you back to what you started with.

save_ should use mapped image, not original, to detect element type

I think that img here:

T = eltype(img)
should actually be imgm. That is, I think save_() should be getting the element type of the result of mapCG, not the original input image. But I'm not familiar with the inner workings of this package, so I may be wrong.

This came up while working on JuliaImages/Images.jl#624 To see the issue, try this:

julia> using Colors, FixedPointNumbers, FileIO, QuartzImageIO

julia> QuartzImageIO.save_(Stream(format"PNG", IOBuffer()), zeros(HSV{Float32}, 1, 1))
ERROR: QuartzImageIO: tried to save unknown buffer type ColorTypes.HSV{Float32}
 in #save_#8(::Bool, ::ImageCore.#clamp01nan, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Array{ColorTypes.HSV{Float32},2}) at /Users/rdeits/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:250
 in (::QuartzImageIO.#kw##save_)(::Array{Any,1}, ::QuartzImageIO.#save_, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Array{ColorTypes.HSV{Float32},2}) at ./<missing>:0
 in #save#5(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Array{ColorTypes.HSV{Float32},2}, ::Vararg{Array{ColorTypes.HSV{Float32},2},N}) at /Users/rdeits/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:20
 in (::QuartzImageIO.#kw##save)(::Array{Any,1}, ::QuartzImageIO.#save, ::FileIO.File{FileIO.DataFormat{:PNG}}, ::Array{ColorTypes.HSV{Float32},2}, ::Vararg{Array{ColorTypes.HSV{Float32},2},N}) at ./<missing>:0
 in getblob at /Users/rdeits/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:313 [inlined]
 in #save_#11 at /Users/rdeits/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:304 [inlined]
 in save_(::FileIO.Stream{FileIO.DataFormat{:PNG},Base.AbstractIOBuffer{Array{UInt8,1}}}, ::Array{ColorTypes.HSV{Float32},2}) at /Users/rdeits/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:304

Replacing img with imgm avoids that error.

save() an image file

Since I upgraded to Images.jl 0.5 I've been trying to save image files. I'm doing things like this, but with no luck:

julia> using Images, FileIO, QuartzImageIO

julia> img = load("/tmp/f1.jpg")
RGB4 Images.Image with:
  data: 1916x800 Array{ColorTypes.RGB4{FixedPointNumbers.UFixed{UInt8,8}},2}
  properties:
    imagedescription: <suppressed>
    spatialorder:  x y
    pixelspacing:  1 1

julia> save("/tmp/test.jpg", img)
WARNING: FileIO.NotInstalledError(:ImageMagick,"")
 in checked_import at /Users/me/.julia/v0.4/FileIO/src/loadsave.jl:12
 in save at /Users/me/.julia/v0.4/FileIO/src/loadsave.jl:91
 in save at /Users/me/.julia/v0.4/FileIO/src/loadsave.jl:51
Library ImageMagick is not installed but can load format: FileIO.File{FileIO.DataFormat{:JPEG}}("/tmp/test.jpg")
should we install ImageMagick for you? (y/n):

Is there something else I should be doing?

I'm avoiding ImageMagick at the moment (because that doesn't work either).

Should we archive this project?

I am not sure - but it seems that given where Images.jl and ImageMagick.jl are - this package can be archived. @johnnychen94 Perhaps you are the right person to ask?

If not, should we put in effort to update it and have it pass tests on a recent Julia version?

Silent failure related to missing ufixedtype

In getting the tests working, I hit an error with the first TestImages file, "Autumn Leaves". The error turned out to be a missing ufixedtype dict, which I assume migrated over to ImageMagick. No worries, I just put it in here.

The weird thing was the failure mode. FileIO would actually drop down into ImageMagick on its own. Println testing got me to this line, with the missing Images.ufixedtype:

T = pixeldepth <= 8 ? Ufixed8 : ufixedtype[pixeldepth]

Before 5729663, this line would run, then silently return from that function (leading to ImageMagick taking over, and luckily ImageMagick has a different idea of byte ordering, otherwise I wouldn't have even noticed!). A println() on the next line did not run.

I find this weird, how is it that the missing Images.ufixedtype didn't give me some sort of an error? @timholy @SimonDanisch

Tests failing on master

The QuartzImageIO tests are currently failing on master both on Travis (see JuliaImages/Images.jl#667 (comment) ) and locally on my mac. To reproduce (with an empty JULIA_PKGDIR folder):

Pkg.init()
Pkg.add("QuartzImageIO")
Pkg.checkout("QuartzImageIO")
Pkg.test("QuartzImageIO")

which fails with:

Lab: Test Failed
  Expression: (Lab.(oimg)[1].l, img[1].l, atol=0.9)
Stacktrace:
 [1] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:277 [inlined]
 [2] macro expansion at ./test.jl:860 [inlined]
 [3] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:271 [inlined]
 [4] macro expansion at ./test.jl:860 [inlined]
 [5] anonymous at ./<missing>:?
Lab: Test Failed
  Expression: (Lab.(oimg)[1].a, img[1].a, atol=0.4)
Stacktrace:
 [1] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:278 [inlined]
 [2] macro expansion at ./test.jl:860 [inlined]
 [3] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:271 [inlined]
 [4] macro expansion at ./test.jl:860 [inlined]
 [5] anonymous at ./<missing>:?
Lab: Test Failed
  Expression: (Lab.(oimg)[1].b, img[1].b, atol=0.6)
Stacktrace:
 [1] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:279 [inlined]
 [2] macro expansion at ./test.jl:860 [inlined]
 [3] macro expansion at /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl:271 [inlined]
 [4] macro expansion at ./test.jl:860 [inlined]
 [5] anonymous at ./<missing>:?
Test Summary: | Pass  Fail  Total
Saving        |    7     3     10
  RGB         |    1            1
  HSV         |    3            3
  HSL         |    3            3
  Lab         |          3      3
ERROR: LoadError: Some tests did not pass: 7 passed, 3 failed, 0 errored, 0 broken.
while loading /Users/rdeits/Downloads/quartz/packages/v0.6/QuartzImageIO/test/runtests.jl, in expression starting on line 239

Since the last Travis build for QuartzImageIO is good, this is probably the result of some dependency updating. I'll try to figure out what's going on.

HSV saving broken

Something is up recently with HSV saving. This block, extracted from the tests, illustrates the problem.

julia> using Base.Test, FileIO, QuartzImageIO, ColorTypes

julia> using FixedPointNumbers, TestImages, ImageAxes
using Images  # For ImageMeta

julia> using Images  # For ImageMeta

julia> using OffsetArrays

julia> srand(42)
MersenneTwister(UInt32[0x0000002a], Base.dSFMT.DSFMT_state(Int32[964434469, 1073036706, 1860149520, 1073503458, 1687169063, 1073083486, -399267803, 1072983952, -909620556, 1072836235  …  -293054293, 1073002412, -1300127419, 1073642642, 1917177374, -666058738, -337596527, 1830741494, 382, 0]), [1.49883, 1.32935, 1.22115, 1.93464, 1.89353, 1.95906, 1.58691, 1.8118, 1.09687, 1.35367  …  1.02514, 1.25471, 1.31046, 1.06786, 1.97371, 1.41167, 1.01982, 1.3229, 1.21062, 1.11614], 382)

julia> img = rand(HSV{Float32}, 8, 10)

[An expected random image, thanks to TerminaExtensions.jl]

julia> mydir = tempdir() * "/QuartzImages"

julia> out_name = joinpath(mydir, "hsv.png")

julia> save(out_name, img)
329

julia> oimg = load(out_name)

[An unexpected, very red image with similar intensity pattern as img]

julia> img[1]
HSV{Float32}(31.096245f0,0.63024366f0,0.9028468f0)

julia> HSV.(oimg)[1]
HSV{Float32}(1.2413793f0,0.6304348f0,0.9019608f0)

Notice the hue value in img[1] vs. the converted oimg[1].

Question: is there anything that changed recently that would affect the hue value alone in HSV images? I'm guessing something similar is happening with HSL and Lab images, because both of those tests fail too. Pinging @timholy

Convert(Image, ...) problem on IJulia

Hi all,

on a clean IJulia notebook, executing the following

using Images
convert(Image, randn(256,256))

returns

WARNING: InexactError()
 in trunc at float.jl:374
 in copy! at abstractarray.jl:310
 in convert at array.jl:239
 in _convert at ~/.julia/v0.4/Images/src/core.jl:426
 in save_ at ~/.julia/v0.4/QuartzImageIO/src/QuartzImageIO.jl:258
 in getblob at ~/.julia/v0.4/QuartzImageIO/src/QuartzImageIO.jl:282
 in save at ~/.julia/v0.4/QuartzImageIO/src/QuartzImageIO.jl:48
 in save at ~/.julia/v0.4/FileIO/src/loadsave.jl:95
 in writemime at ~/.julia/v0.4/Images/src/writemime.jl:30
 in base64encode at base64.jl:160
 in display_dict at ~/.julia/v0.4/IJulia/src/execute_request.jl:32
 in execute_request_0x535c5df2 at ~/.julia/v0.4/IJulia/src/execute_request.jl:212
 in eventloop at ~/.julia/v0.4/IJulia/src/IJulia.jl:141
 in anonymous at task.jl:447
Trying next loading library! Please report this issue on the Github page for QuartzImageIO

before showing the correct result.

The same command on the REPL runs just fine.

Naming bikeshed

I hate to bring this up, but I'm not sure QuartzImageIO is the best name for this. Quartz refers to the drawing layer, if I understand correctly. Most of actual Image IO library functions used here come from CoreGraphics (which is a mouthful, admittedly)

Naming here is a bit of a mess, actually. See the discussion here: http://stackoverflow.com/questions/1877987/whats-the-difference-between-quartz-core-core-graphics-and-quartz-2d

I'm not overly fond of OSXnative. That was a fine name when it was buried three layers down in Images, but not so good for public consumption. But should OS X be part of the name? Or Mac?

OSXImageIO
MacImageIO -- I think I like this one, at the moment.

In any event, it might be best to settle this quickly, before anyone discovers this package 😄

Saving a multi-frame GIF gives nonsense

Saving a normal image as a GIF works fine, but when I try to save a three dimensional array as an animated GIF I get an animated GIF that seems to have little relation to the image I'm trying to save, and even changes each time I save it. A minimal example of the issue:

using FileIO, TestImages
img = testimage("mandrill");
save("mandrill.gif", cat(3, img, img))

This will give a different image each time the save line is called with, at best, only vague resemblance to the original image.
mandrill
mandrill 2
mandrill

If I instead save as a non-animated image, everything works as expected

using FileIO, TestImages
img = testimage("mandrill");
save("mandrill.gif", img)

mandrill

I'm on a Mac, 10.11.6, using Julia Version 0.6.2. I'm not sure where to find version numbers for packages, but I called Pkg.update() earlier today, so everything should be at the latest version.

Note: I'm fairly certain that FileIO is calling QuartzImageIO to write the file out based on its registry file, but am not sure how to verify this.

Edit: It seems that while my computer displays the images as two rapidly alternating frames, my browser only shows the first frame; I suppose this might be indicative of some issue with how information about the two frames is encoded?

Errors and deprecations on v0.6

Starting to cautiously test on Julia v0.6, but QuartzImageIO isn't happy. For the record:

WARNING: deprecated syntax "typealias CFURLRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:8.
Use "const CFURLRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CFStringRef Ptr{UInt8}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:9.
Use "const CFStringRef = Ptr{UInt8}" instead.

WARNING: deprecated syntax "typealias CFDictionaryRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:10.
Use "const CFDictionaryRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGImageDestinationRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:11.
Use "const CGImageDestinationRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGImageRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:12.
Use "const CGImageRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGColorSpaceRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:13.
Use "const CGColorSpaceRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGContextRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:14.
Use "const CGContextRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias Color1{T} Color{T,1}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:340.
Use "Color1{T} = Color{T,1}" instead.

WARNING: deprecated syntax "typealias Color2{T,C<:Color1} TransparentColor{C,T,2}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:341.
Use "Color2{T,C<:Color1} = TransparentColor{C,T,2}" instead.

WARNING: deprecated syntax "typealias Color3{T} Color{T,3}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:342.
Use "Color3{T} = Color{T,3}" instead.

WARNING: deprecated syntax "typealias Color4{T,C<:Color3} TransparentColor{C,T,4}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:343.
Use "Color4{T,C<:Color3} = TransparentColor{C,T,4}" instead.
INFO: Precompiling module QuartzImageIO.

WARNING: deprecated syntax "typealias CFURLRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:8.
Use "const CFURLRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CFStringRef Ptr{UInt8}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:9.
Use "const CFStringRef = Ptr{UInt8}" instead.

WARNING: deprecated syntax "typealias CFDictionaryRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:10.
Use "const CFDictionaryRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGImageDestinationRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:11.
Use "const CGImageDestinationRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGImageRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:12.
Use "const CGImageRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGColorSpaceRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:13.
Use "const CGColorSpaceRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias CGContextRef Ptr{Void}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:14.
Use "const CGContextRef = Ptr{Void}" instead.

WARNING: deprecated syntax "typealias Color1{T} Color{T,1}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:340.
Use "Color1{T} = Color{T,1}" instead.

WARNING: deprecated syntax "typealias Color2{T,C<:Color1} TransparentColor{C,T,2}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:341.
Use "Color2{T,C<:Color1} = TransparentColor{C,T,2}" instead.

WARNING: deprecated syntax "typealias Color3{T} Color{T,3}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:342.
Use "Color3{T} = Color{T,3}" instead.

WARNING: deprecated syntax "typealias Color4{T,C<:Color3} TransparentColor{C,T,4}" at /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl:343.
Use "Color4{T,C<:Color3} = TransparentColor{C,T,4}" instead.

ERROR: LoadError: TypeError: ccall method definition: expected Type, got TypeVar
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:539
 [2] include(::String) at ./sysimg.jl:14
 [3] anonymous at ./<missing>:2
while loading /Users/me/.julia/v0.6/QuartzImageIO/src/QuartzImageIO.jl, in expression starting on line 418
Errors encountered while loading "/tmp/image.png".
All errors:
   ErrorException("Failed to precompile QuartzImageIO to /Users/me/.julia/lib/v0.6/QuartzImageIO.ji.")
   FileIO.NotInstalledError(:ImageMagick, "")
Fatal error:
ERROR: LoadError: Failed to precompile QuartzImageIO to /Users/me/.julia/lib/v0.6/QuartzImageIO.ji.
Stacktrace:
 [1] checked_import(::Symbol) at /Users/me/.julia/v0.6/FileIO/src/loadsave.jl:12
 [2] #load#17(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:PNG}}) at /Users/me/.julia/v0.6/FileIO/src/loadsave.jl:83
 [3] load(::FileIO.File{FileIO.DataFormat{:PNG}}) at /Users/me/.julia/v0.6/FileIO/src/loadsave.jl:75
 [4] #load#13(::Array{Any,1}, ::Function, ::String) at /Users/me/.julia/v0.6/FileIO/src/loadsave.jl:45
 [5] loadsourceimage(::String) at /Users/me/projects/programming/julia/testing.jl:19
 [6] include_from_node1(::String) at ./loading.jl:539
 [7] include(::String) at ./sysimg.jl:14
Julia Version 0.6.0-pre.alpha.0
Commit 29bc2ac (2017-02-28 13:15 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, sandybridge)
 - QuartzImageIO                 0.2.1

Image is all green

Sorry for the very unspecific issue, but I want to keep track of this and I didn't want to miss out on the chance that someone has a quick idea about where that can come from.
I can upload the photo if necessary!

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

RGBX not defined

Trying to load QuartzImageIO does not seem to work: I get an error saying RGBX not defined (see below). After I ran what is depicted below, I tried adding and using Colors and ColorTypes, but I am getting the same error. As per the readme, I have also tried just using FileIO and loading a jpg, but cannot get this working (same error).

pkg> status
Status `~/FaceDetection.jl/Project.toml`
  [336ed68f] CSV v0.7.7
  [a93c6f00] DataFrames v0.21.7
  [5789e2e9] FileIO v1.4.3
  [c91e804a] Gadfly v1.3.0
  [09f84164] HypothesisTests v0.10.0
  [4381153b] ImageDraw v0.2.3
  [82e4d734] ImageIO v0.3.0
  [6218d12a] ImageMagick v1.1.6
  [86fae568] ImageView v0.10.9
  [916415d5] Images v0.22.2
  [f09324ee] Netpbm v0.4.0
  [91a5bcdd] Plots v1.0.14
  [92933f4c] ProgressMeter v1.3.1
  [dca85d43] QuartzImageIO v0.7.3
  [f3b207a7] StatsPlots v0.14.11
  [8ba89e20] Distributed
  [de0858da] Printf
  [8dfed614] Test

julia> using Images, FileIO, QuartzImageIO
[ Info: Precompiling QuartzImageIO [dca85d43-d64c-5e67-8c65-017450d5d020]
ERROR: LoadError: UndefVarError: RGBX not defined
Stacktrace:
 [1] top-level scope at /Users/jakeireland/.julia/packages/QuartzImageIO/hnNSo/src/QuartzImageIO.jl:354
 [2] include(::Function, ::Module, ::String) at ./Base.jl:380
 [3] include(::Module, ::String) at ./Base.jl:368
 [4] top-level scope at none:2
 [5] eval at ./boot.jl:331 [inlined]
 [6] eval(::Expr) at ./client.jl:467
 [7] top-level scope at ./none:3
in expression starting at /Users/jakeireland/.julia/packages/QuartzImageIO/hnNSo/src/QuartzImageIO.jl:354
ERROR: Failed to precompile QuartzImageIO [dca85d43-d64c-5e67-8c65-017450d5d020] to /Users/jakeireland/.julia/compiled/v1.5/QuartzImageIO/n8vDP_S0ZaK.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1290
 [3] _require(::Base.PkgId) at ./loading.jl:1030
 [4] require(::Base.PkgId) at ./loading.jl:928
 [5] require(::Module, ::Symbol) at ./loading.jl:923

0.5 deprecations

bytestring(p::Union{Ptr{Int8},Ptr{UInt8}}) and pointer_to_array{T}(p::Ptr{T},d::Union{Integer,Tuple{Vararg{Integer}}},own::Bool=false) are deprecated in 0.5.

WARNING: bytestring(p::Union{Ptr{Int8},Ptr{UInt8}}) is deprecated, use unsafe_string℗ instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in bytestring(::Ptr{UInt8}) at ./deprecated.jl:50
 in CFStringGetCString(::Ptr{Void}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:441
 in read_and_release_imgsrc(::Ptr{Void}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:95
 in load_(::String) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:67
 in #load#9(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:43
 in load(::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:43
 in #load#17(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:82
 in load(::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:73
 in #load#13(::Array{Any,1}, ::Function, ::String) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:45
 in load(::String) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:45
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318

WARNING: pointer_to_array{T}(p::Ptr{T},d::Union{Integer,Tuple{Vararg{Integer}}},own::Bool=false) is deprecated, use unsafe_wrap(Array,p,d,own) instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in pointer_to_array(::Ptr{FixedPointNumbers.UFixed{UInt8,8}}, ::Tuple{Int64,Int64,Int64}, ::Bool) at ./deprecated.jl:50
 in fillcolor!(::Array{FixedPointNumbers.UFixed{UInt8,8},3}, ::Ptr{Void}, ::Int64) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:215
 in read_and_release_imgsrc(::Ptr{Void}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:138
 in load_(::String) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:67
 in #load#9(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:43
 in load(::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl:43
 in #load#17(::Array{Any,1}, ::Function, ::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:82
 in load(::FileIO.File{FileIO.DataFormat{:JPEG}}) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:73
 in #load#13(::Array{Any,1}, ::Function, ::String) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:45
 in load(::String) at /Users/me/.julia/v0.5/FileIO/src/loadsave.jl:45
 in include_from_node1(::String) at ./loading.jl:426
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
julia> versioninfo()
Julia Version 0.5.0-rc0+0
Commit 0030eec* (2016-07-26 20:22 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, sandy bridge
```)

Problems on v5.1

I tried using QuartzimageIO in a Jupyter notebook on v0.5.1, with this result:

INFO: Precompiling module QuartzImageIO.
ERROR: LoadError: syntax: expected identifier after "const"
 in include_from_node1(::String) at ./loading.jl:488
 in include_from_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval(::Module, ::Any) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in process_options(::Base.JLOptions) at ./client.jl:242
 in _start() at ./client.jl:321
 in _start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
while loading /Users/me/.julia/v0.5/QuartzImageIO/src/QuartzImageIO.jl, in expression starting on line 339
Failed to precompile QuartzImageIO to /Users/me/.julia/lib/v0.5/QuartzImageIO.ji.

 in compilecache(::String) at ./loading.jl:593
 in require(::Symbol) at ./loading.jl:422
 in require(::Symbol) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

but if I try to update packages in the REPL I see this:

WARNING: julia is fixed at 0.5.1 conflicting with requirement for QuartzImageIO: [0.6.0-,∞)

julia> Pkg.status("QuartzImageIO")
 - QuartzImageIO                 0.3.0              master

Blocking issues?

I'd really like to tag a new version of Images, but remaining concerns about this package are the main blocker. I haven't been able to follow everything due to a schedule crunch over the last few days, but if I remember correctly it's been decided that the name is going to stay unchanged. If so, that is no longer a concern.

Is this the only remaining issue? If so, presumably we need to finish & merge JuliaIO/FileIO.jl#43.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.