WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 8 months ago

#135 new defect

Test for the function image_make_intermediate_size()

Reported by: markoheijnen Owned by:
Priority: normal Milestone:
Component: Images/EXIF Keywords: has-patch
Cc:

Description

The function doesn't have any tests. There was a small bug reported at #WP22181.

I included a test file that does 4 minor tests.

Attachments (1)

intermediate_size.php (1.1 KB) - added by markoheijnen 8 months ago.

Download all attachments as: .zip

Change History (3)

comment:1 kurtpayne8 months ago

  • Cc kurtpayne removed
  • Component changed from Admin Screen to Images/EXIF

How does this handle the cases where a single dimension is set to zero?

I may be reading it wrong, but shouldn't WP_Error bubble up from resize and cause make_intemediate_size return false? It looks like the assertions here look for an array.

comment:2 markoheijnen8 months ago

Yes, that is correct. At least for non cropping. When only one is given then the other one will be calculated. The same as it would be a really really long integer.

The only thing what I'm not sure about is when only one is given and you want to crop. Then I would say an error would occur but that also wasn't the case before the changes.

Note: See TracTickets for help on using tickets.