> On Wed, 13 May 2009, Stefan Kilp [sk-software] wrote: > > > i try to crop a square from the middle of a picture (mostly it is the > > important part). > > the square is needed for a thumb list. > > > > example ( a 80x80 square form the middle of an image) > > > > image 200x200 -> crop 60,60 80x80 > > > > image 300x1000 -> crop 110, 460 dim 80x80 > > > > image 100 x 20 -> crop 10,0 80x20 > > > > the problem is that the parameter for the filter has to be defined before > > the image is > > processed. so right now i have to get the image size, define a filter, get > > next image, get > > imagesize, define filter, and so on. > > > > thats why i was asking for a kind of callback function for the filter so i > > can define crop > > dynamicly >
my explanations seems to be so very bad :-( i dont want to fill the missing background in the thumb, but i want to optimize the proccess of NOT defining a crop filter 100 times if i have 100 images to crop. the only thing that has to be changed on ever image is the crop position, so on calling $obj->transform('myCrop', $source, $dest); which would call a function like the one below function cropParameters($curImageinfo, &$cropParametes) { $cropWidth = 80; $cropHeight = 80; $cropParameters['x] = round(($curImageinfo['width'] - $cropWidth) / 2); $cropParameters['y] = round(($curImageinfo['height'] - $cropHeight) / 2); } regards stefan > Ah, we have a specific function for this, the "filledThumbnail" filter: > > http://ezcomponents.org/docs/tutorials/ImageConversion#creating-thumbnails > > and > > http://ezcomponents.org/docs/api/trunk/ImageConversion/ezcImageThumbnailFilters.html > > regards, > > -- > Derick Rethans > eZ components Product Manager > eZ systems | http://ez.no > -- Stefan Kilp SK-Software, Entwicklung & Beratung email: k...@sk-software.de fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. ----------------------------------------------------- -- Components mailing list Components@lists.ez.no http://lists.ez.no/mailman/listinfo/components