-
Notifications
You must be signed in to change notification settings - Fork 42
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
A few potential fixes #13
Comments
Thanks a lot, good spot on the resizing not working - poor ownership on my part as I've not updated this repo in years myself and that will have come in from another PR I accepted. Should have reviewed it a bit more rigorously! Same for the maxSize, introduced my someone else. A lesson to be learned in accepting requests without enough review! Very interesting bonus it works with other image types too :) Suppose it makes sense when the browser can convert the source file into a canvas. |
Thanks for the reply. Something I should add about the addition of other
image types is that I think the Exif.js library (and thus autoRotate) is
just for jpegs, so I did have to add a bit to detect that as well. If it's
helpful, here's a link to the version I've modified:
https://github.com/processwire/processwire/blob/dev/wire/modules/Inputfield/InputfieldImage/PWImageResizer.js
Thanks again for your work with this library.
…On Thu, May 25, 2017 at 10:08 AM, Ross Taylor-Turner < ***@***.***> wrote:
Thanks a lot, good spot on the resizing not working - poor ownership on my
part as I've not updated this repo in years myself and that will have come
in from another PR I accepted. Should have reviewed it a bit more
rigorously! Same for the maxSize, introduced my someone else. A lesson to
be learned in accepting requests without enough review!
Very interesting bonus it works with other image types too :) Suppose it
makes sense when the browser can convert the source file into a canvas.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUCUHpZochBqTjNUys9mqnmrsrCm3fSks5r9YtSgaJpZM4Nma8b>
.
|
Was just coming to point out the maxSize oopsie, but it's already here. Cheers |
Thanks for this Image uploader/resizer. I've been adapting it for another purpose (just the resizing part), and noticed a few things weren't working in my own testing. It looks like all are simple fixes, and just wanted to pass them along:
As far as I can tell, the client-side resizing does not come into play at all unless the
config.autoRotate
option istrue
. See this conditional. I basically just removed the autoRotate conditional and left everything within it, and it seems to work fine.The
config.maxSize
option doesn't appear to work as described in the README. It suggests that it is expecting a float like 1.7, but the actual code seems to be expecting something different. I was able to correct it by adjusting the maxSize part of thescaleImage
function to the following (though I'm guessing you know something better):image/jpeg
content-type from thecanvas.toDataURL()
call withthis.currentFile.type
at the bottom of thescaleImage
function. I changed it to this below, and it appears to be working, though I may be missing something.The text was updated successfully, but these errors were encountered: