mindbrix / UIImage-PDF

Simple UIImage PDF renderer category for iOS scalable assets
http://blog.mindbrix.co.uk/2012/02/10/ios-scalable-assets/
1.24k stars 155 forks source link

Prevent invalid path from crashing the entire app and get correct mediarect #9

Closed mac-cain13 closed 12 years ago

mac-cain13 commented 12 years ago

Hi!

This pull req contains 2 commits. One contains a fix for invalid paths, the library will now just return nil objects instead of crashing. This is more like UIImage is behaving in general and somewhat easier to work with if you generate filenames dynamically and it's possible that the image doesn't exists.

The second makes sure the correct mediarect is returned, if you rendered a image on page 3 (or any page other then 1) the mediarect from page 1 was used. That is not necesseraly the correct rect, this commit fixes that.

Hope you will take this changes in! Let me know if we need to change or tweak anything to make it in to your repos!

Cheers, Mathijs Kadijk

mindbrix commented 12 years ago

Hi Mathijs. Many thanks for these updates. It's good to have some help.

Best, Nigel.