Closed BrodaNoel closed 3 years ago
Hi @BrodaNoel and sorry for the late reply.
I think what you are referring to is a breaking change that happened in browsers - browsers updated their logic on the auto-orientation of images, now doing it automatically.
As a result, images that had to be returned as canvas objects to be able to adjust their orientation now could be returned as is, without converting them into canvas elements first.
The possibility that the library might return and img
element was always there and documented:
https://github.com/blueimp/JavaScript-Load-Image#callback-arguments
Hi everyone. I can't find in which commit you had it, but... check this out:
During... I guess years, we have been using this code in my company's project:
Seems like some weeks/months ago, this feature stoped working (it's a feature we don't frecuently use, so, we are not sure when it got broken).
The bug was simple:
img.toBlob
isundefined
. I had to dig a lot inside your code (forked, and running tests), where I realized that in this test, you ALSO have it undefined:So, after 3 millon
console.log
, I realized that here, you do have it defined:Soooo, I added the
{ canvas: true }
option, and now it's fixed in the project.The problem, is that it is a breaking change. Which is probably the root of the problem of https://github.com/blueimp/JavaScript-Canvas-to-Blob/issues/35. That's just another dev that didn't add the
canvas: true
, so.toBlob
is undefined.As you may image, I fixed it doing this: