AndreasBaumgart / Zend_Filter_ImageSize

Extension for ZendFramework. A Zend_Filter implementation for resizing images.
Other
22 stars 4 forks source link

Custom patterns for generating file names using Dependency Injection #2

Closed AndreasBaumgart closed 11 years ago

AndreasBaumgart commented 13 years ago

At the moment it's not possible to generate custom file name patterns without overriding getThumbnailBasename() and thus creating a subclass of Zend_Filter_ImageSize. This shouldn't be necessary as the process of generating a file name is just a supplying part and could also reside in a different object, which can be injected on call.

travisfisher commented 11 years ago

Has this been addressed? I need exactly this functionality and I don't want to have to subclass.

AndreasBaumgart commented 11 years ago

Yes. Have a look at the latest revision on master and the examples in tests/ExamplesTest.php.

The idea is to implement Polycast_Filter_ImageSize_PathBuilder_Interface and pass it to the filter via $filter->setOutputPathBuilder($yourBuilderInstance).

I rewrote the whole library though. The API changed somewhat and the namespace is not longer Zend but Polycast. But apart from that it still does the same job.