Op woensdag 3 mei 2006 03:41, schreef Adrian Rossouw:
I have recently developed a small, but EXTREMELY usefull autocropper for a Rails project. Good news: only four lines of code. Bad news: you need Ruby apis for it. But I bet there is sime PHP equivalent around. And because it uses imagemagick, its not hard to write these apis yourself. But, if you use imagemagick, it is not hard to make this a lot more user friendly. Because, however cool a DHTML cropper might be: much cooler is to have the system crop it for you. Nice cropping off course. Here is what I did (sortof): 1 stretch the contrast a lot. make sure the outer borders are white after this (i played with teh values a bit) 2 smart crop that image. (http://studio.imagemagick.org/pipermail/magick-users/2004-December/014309.ht...) 3 trow that image away, but remember the offset and crop values. 4 use these values to crop, using crop! (http://studio.imagemagick.org/RMagick/doc/image1.html#crop_bang) This concept needs finetuning, but vecause I use crop! the first 3 steps hardly add any value anyway :) I found that at least 90% of the images are already cropped very well by crop! Conclusion: It is perfeclty possible to do this without user interaction. And taking difficult tasks away from users is always the better option that adding these tasks. Obviously it could be good to make that DHTML cropper optional. s in: Drupal will crop the stuff for you correct 90% of the tilmes. And if the last10% bother you, you can change these by hand. Bèr -- PGP ber@webschuur.com http://www.webschuur.com/sites/webschuur.com/files/ber_webschuur.asc PGP berkessels@gmx.net http://www.webschuur.com/sites/webschuur.com/files/ber_gmx.asc