If I understand you correctly, you are suggesting to always resize the image (on demand) when it is used somewhere... ?
I thought there would be a way to make this happen once, right after the image(/images) have been uploaded, in this multi-page dialog (Editing file 1 of X), that comes after pressing the upload button, or directly in the "Add Images"-dialog (before you click on the blue upload button)...
For now, I have written a function that lets me check from within the template if an uploaded image is wider than what I want. If so, I set a css width value, so that the browser can reduce the width. But since I exactly know, how big the width must be for all images that I upload ( < 700px ), it would make more sence to simply reduce the file size on uploading, wouldn't it... ?
For those who stumble across this post, wondering how I did it, here is my code...
<% control ReferenzenBild.Bild %>
<% if isWiderThan(700) %>
<img src="$URL" style="width: 740px" />
<% else %>
<img src="$URL"/>
<% end_if %>
<% end_control %>
ReferenzenBild is what you call 'Resource', // Source class in your ResourcePage
Bild is what you call 'Attachment' => 'File', in your Resource
Instead of File I use ImageExtended, a class that extends Image containing my isWiderThan function
With "your" I mean what I read in http://doc.silverstripe.com/doku.php?id=modules:dataobjectmanager
public function isWiderThan($width = 740){
return ($this->getWidth() > $width);
}
By the way, it's so good, that you programmed this module, I was looking for something like that since my first contact with silverstripe (half a year).
Thank you :D !!!