stomita/ios-imagefile-megapixel

[Enhancement] add Offset and Crop coordinates

kelexel opened this issue · 0 comments

Hello !

Well, first, kudos to @stomita for finding this hack!
I can confirm this to be working on iOS7!

I plan to use this lib as a fallback for < iOS8 devices in my project.

I need squared images, so I managed to add a destOffsetX and destOffsetY settings.

But I would also need to crop portion (sX, sY, sW, sH) of the image..
And this is where part of the logic of the code eludes me.

While I can easily pin this to renderImageToCanvas(), I cannot figure how my sX, sY, sW, sH would interact in the two while() loops.

If anyone has a clue, that would be appreciated, as I have to admit, leaving iOS7 behind because of such canvas issues, kind of makes me... Hrmm... Unhappy.

Ps: If anyone wants my squared-offseted-image-mod, please drop a line, I will fill a PR.