JuliaIO / Sixel.jl

The Julia wrapper of libsixel
MIT License
41 stars 5 forks source link

offset generic array back to 1-based indexing array #12

Closed johnnychen94 closed 3 years ago

johnnychen94 commented 3 years ago

Some image processing operations will produce OffsetArray as an output, in which case convert(Array{T, N}, img::OffsetArray) does not work.

For example,

using ImageTransformations, TestImages, Sixel
img = testimage("camera")
imgr = imrotate(img, 0.4) # 672×672 OffsetArray(::Array{Gray{N0f8},2}, -79:592, -79:592)
sixel_encode(imgr) # errors

With this PR:

demo
codecov[bot] commented 3 years ago

Codecov Report

Merging #12 (205b669) into master (dc3f05f) will increase coverage by 0.36%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   38.05%   38.41%   +0.36%     
==========================================
  Files          10       10              
  Lines         339      341       +2     
==========================================
+ Hits          129      131       +2     
  Misses        210      210              
Impacted Files Coverage Δ
src/Sixel.jl 100.00% <ø> (ø)
src/encoder.jl 87.50% <100.00%> (+1.78%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dc3f05f...205b669. Read the comment docs.