Image resize dimension logic enhancement

38 views
Skip to first unread message

Nic Horstmeier

unread,
Dec 11, 2013, 11:28:51 PM12/11/13
to silverst...@googlegroups.com
Hi all,

In a lot of projects I've worked on I've ended up adding image class extensions to simply add logic determining if the uploaded image matches the corresponding dimensions as those provided in resize function calls. I don't think the Image class handles this kind of logic at this point and wondered if this seemed like an enhancement that is relevant enough to work towards.

Thanks for your thoughts,

Nic

Simon J Welsh

unread,
Dec 11, 2013, 11:30:48 PM12/11/13
to silverstripe-dev@googlegroups.com Development
Core already does this (https://github.com/silverstripe/silverstripe-framework/blob/3.1/model/Image.php#L294-L298 for an example).
> --
> You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
> To post to this group, send email to silverst...@googlegroups.com.
> Visit this group at http://groups.google.com/group/silverstripe-dev.
> For more options, visit https://groups.google.com/groups/opt_out.

---
Simon Welsh
Admin of http://simon.geek.nz/

Nic Horstmeier

unread,
Dec 11, 2013, 11:35:22 PM12/11/13
to silverst...@googlegroups.com
Ah, noted. Does this cover template calls as well?

Simon J Welsh

unread,
Dec 11, 2013, 11:36:25 PM12/11/13
to silverstripe-dev@googlegroups.com Development
Yes. If you’re calling the generate*() methods directly, the checks don’t happen but in all other cases (including in the templates) they do.

Nic Horstmeier

unread,
Dec 11, 2013, 11:38:02 PM12/11/13
to silverst...@googlegroups.com
Thanks for the clarification.
Reply all
Reply to author
Forward
0 new messages