Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imresize throw StackOverflowError with sz of array type #742

Closed
johnnychen94 opened this issue Aug 29, 2018 · 3 comments
Closed

imresize throw StackOverflowError with sz of array type #742

johnnychen94 opened this issue Aug 29, 2018 · 3 comments

Comments

@johnnychen94
Copy link
Member

johnnychen94 commented Aug 29, 2018

The document of imresize doesn't say sz must be Tuple type, so I just try the MATLAB way of using imresize, and it throws an unexpected StackOverflowError.

  • use [128,128] as size, it's Array type.
  • use ceil.(size(img)/0.5) as size, it is Tuple{Float64,Float64} Type
using Images, TestImages
lena = testimage("lena_gray_256")

imresize(lena, (128, 128)) # work as expected
imresize(lena, [128, 128]) # throw StackOverflowError
imresize(lena, (128.0, 128.0)) # throw StackOverflowError
@Evizero
Copy link
Member

Evizero commented Aug 29, 2018

Good catch! At the very least this should throw a more informative error.

looks like the culprint is https://github.com/JuliaImages/ImageTransformations.jl/blob/master/src/resizing.jl#L171

@Evizero
Copy link
Member

Evizero commented Aug 29, 2018

this is a issue in ImageTransformations.jl, so I will close the issue here.

@Evizero Evizero closed this as completed Aug 29, 2018
@johnnychen94
Copy link
Member Author

johnnychen94 commented Aug 29, 2018

Well, it looks like the document is not clear enough to me, on what argument type should be, and what inds is...

I think it should be something like

imresize(img, sz::Tuple{Vararg{T}}) where T <: Integer -> imgr
imresize(img, ind1::T, ind2::T, ...) where T <: Integer -> imgr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants