-
Notifications
You must be signed in to change notification settings - Fork 7
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
scaleBilinear hangs when the target width is 0 #24
Comments
Are you sure that this is related to this library? If it is, it should be possible to create an repro example without any networking stuff involved. |
You're right. I've update the code above to not use any network, simply read a file named |
Hi @mrkkrp, can you please have another look at this? I've removed all networking related code from the repro sample. It's only using local files, and the same issue persists. |
It is on my todo list, I'll look at it as soon as I have time. |
This hangs because you scale to width 0. After dividing where
width = dynamicMap imageWidth image
height = dynamicMap imageHeight image
scaleFactor :: Double
scaleFactor = fromIntegral scaleToHeight / fromIntegral height
scaleToWidth = floor (scaleFactor * fromIntegral width) Probably, there is also a bug in |
I'm trying to write a simple service that listens for requests to scale PNG images hosted on remote storage. After scaling and re-encoding into PNG format, trying to upload/save the image to the remote storage/local file causes the process to hang with ~99% cpu usage.
Originally, I tried using
Network.HTTP.Simple
at first, the code below is usingsavePngImage
to make sure it nothing to do with the client (also triedwreq
). Uploading a short text string or the original image works well. I also tried initiating the request with either lazy or strictByteString
- but it's all the same.The upload request is not even starting, but when I save to a file, like the code below, a 0-sized file is created. Pretty new to Haskell, so I'm not really sure how to proceed in figuring out what's causing this issue.
Any pointers on what might help me shed some light on what's going on?
The code below is somewhat minimal, I tinkered with it quite a bit to narrow it down to the actual point of uploading the file, obviously though, non-strictness could mean I'm still wrong about it :-).
TestScale.hs
project.yaml
Stack resolver is
lts-17.11
.EDIT: clean up the code a bit.
EDIT2: removed all networking code.
The text was updated successfully, but these errors were encountered: