corcel / acf

Advanced Custom Fields (ACF) plugin for Corcel
127 stars 100 forks source link

Fixes regarding handling of image sizes, in the Image class. #29

Closed lasmanis closed 7 years ago

lasmanis commented 7 years ago

Two issues addressed, regarding the Image field class.

  1. URL field was not being filled in the fillThumbnailFields method. (So, calls like this: $image->size('large')->url would be null
  2. Added the option to have the original image as a fallback, when requesting a certain thumbnail size, if said size does not exist, or the crop for this size has not been created. This resembles the default WordPress behavior.
  3. Added new assertions to test the above items.

Unit test results:

PHPUnit 4.2.2 by Sebastian Bergmann.

Configuration read from [...]\acf\phpunit.xml

................................................

Time: 640 ms, Memory: 13.00MB

OK (48 tests, 105 assertions)
jgrossi commented 7 years ago

Hi @lasmanis! Thanks for the PR. Awesome job! Cheers, JG.