@@ -367,7 +367,7 @@ function _save(png_ptr, info_ptr, image::S;
367
367
end
368
368
else
369
369
image_eltype = eltype (image)
370
- if (image_eltype <: BGR || image_eltype <: BGRA || image_eltype <: ABGR )
370
+ if (image_eltype <: BGR || image_eltype <: BGRA || image_eltype <: ABGR || image_eltype <: ARGB32 )
371
371
png_set_bgr (png_ptr)
372
372
end
373
373
@@ -515,14 +515,11 @@ _get_bit_depth(img::AbstractArray{<:Bool}) = 8 # TODO: write 1 bit-depth images
515
515
_get_bit_depth (img:: AbstractArray{<:UInt8} ) = 8
516
516
_get_bit_depth (img:: AbstractArray{<:UInt16} ) = 16
517
517
518
- _get_color_type (x:: AbstractArray{<:Gray{T}} ) where {T} = PNG_COLOR_TYPE_GRAY
519
- _get_color_type (x:: AbstractArray{<:GrayA{T}} ) where {T} = PNG_COLOR_TYPE_GRAY_ALPHA
520
- _get_color_type (x:: AbstractArray{<:RGB{T}} ) where {T} = PNG_COLOR_TYPE_RGB
521
- _get_color_type (x:: AbstractArray{<:RGBA{T}} ) where {T} = PNG_COLOR_TYPE_RGBA
522
- _get_color_type (x:: AbstractArray{<:BGR{T}} ) where {T} = PNG_COLOR_TYPE_RGB
523
- _get_color_type (x:: AbstractArray{<:BGRA{T}} ) where {T} = PNG_COLOR_TYPE_RGBA
524
- _get_color_type (x:: AbstractArray{<:ARGB{T}} ) where {T} = PNG_COLOR_TYPE_RGBA
525
- _get_color_type (x:: AbstractArray{<:ABGR{T}} ) where {T} = PNG_COLOR_TYPE_RGBA
518
+ _get_color_type (x:: AbstractArray{<:Gray} ) = PNG_COLOR_TYPE_GRAY
519
+ _get_color_type (x:: AbstractArray{<:GrayA} ) = PNG_COLOR_TYPE_GRAY_ALPHA
520
+ _get_color_type (x:: AbstractArray{<:AbstractRGB} ) = PNG_COLOR_TYPE_RGB
521
+ _get_color_type (x:: AbstractArray{<:AbstractARGB} ) = PNG_COLOR_TYPE_RGBA
522
+ _get_color_type (x:: AbstractArray{<:AbstractRGBA} ) = PNG_COLOR_TYPE_RGBA
526
523
_get_color_type (x:: IndirectArray ) = PNG_COLOR_TYPE_PALETTE
527
524
function _get_color_type (
528
525
x:: AbstractArray{T, N}
2 commit comments
timholy commentedon Nov 5, 2021
@JuliaRegistrator register
JuliaRegistrator commentedon Nov 5, 2021
Registration pull request created: JuliaRegistries/General/48235
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: