humanmade / WPThumb

:warning: UNMAINTAINED :warning: On demand image resizing for WordPress
https://humanmade.co.uk/wpthumb/
170 stars 32 forks source link

Extended with tiled background images #75

Closed ghost closed 10 years ago

ghost commented 11 years ago

Extends background_fill with an extra argument tile.

Usage: Set background_fill to tile (eg background_fill=tile) and tile to an image path or url (eg `tile=http://domain.ext/image.jpg).

Example:

the_post_thumbnail( 'width=650&height=300&crop=1&resize=true&background_fill=tile&tile=path-or-url-to-tile-image' );

Please review before adding. Works for me but was coded quite fast.

joehoyle commented 11 years ago

Assigned to me to review

ghost commented 11 years ago

A fallback to solid fill needs to be added if no or invalid tile image was provided.

ghost commented 11 years ago

Example image with tiled background fill:

hvfst0wkcgocg

joehoyle commented 11 years ago

@daankortenbach how do you feel about making unit tests for this?

ghost commented 11 years ago

@joehoyle I was already looking into it. Can't promise any dates though.

joehoyle commented 10 years ago

I think this would probably be better as a WP Thumb addon plugin, as I think the functionality is not "mainstream", you can hook into wpthumb_image_post and subclass WP_Thumb_Background_Fill to make this pretty lightweight I'd think. Re-open if needed :)

ghost commented 10 years ago

Agreed, it's an edge case anyway.