pinterest / PINRemoteImage

A thread safe, performant, feature rich image fetcher
Apache License 2.0
4.01k stars 511 forks source link

use frame size for data provider #498

Closed wsdwsd0829 closed 5 years ago

wsdwsd0829 commented 5 years ago

frames can be of different size. (at least for my case). I am not sure if that's not valid format of webp. If it's valid this pr fix that.

ghost commented 5 years ago
1 Warning
:warning: Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by :no_entry_sign: Danger

wsdwsd0829 commented 5 years ago

Request for review.

garrettmoon commented 5 years ago

@wsdwsd0829 frames can be of a different width / height however you are essentially modifying the 'canvas' size. The frame image is actually drawn below at the frame width and height in the CGImageCreate call below?

garrettmoon commented 5 years ago

Oh wait, I thought this was doing something different. Can you upload the image that you're having issues with?

garrettmoon commented 5 years ago

Ok! Now I'm fully on board, but can we just use iterator.fragment.size instead of doing the calculation ourselves?

wsdwsd0829 commented 5 years ago

example: https://i.ytimg.com/an_webp/tSo6dxiE9SM/mqdefault_6s.webp?du=3000&sqp=CIy-m-QF&rs=AOn4CLC9vJO1KtptdEgwsQF8

Seems not working using size: width 320, height 180, 320 * 180 = 57600 fragment.size = 5372.

wsdwsd0829 commented 5 years ago

image

wsdwsd0829 commented 5 years ago

Cool, thanks.