ResourcePicture.resize(rimg.to_blob, tw, th).to_blob
end
+ def opt_img_tag
+ tw, th = ResourcePicture.fix_size_both(MagicNumber['thumbnail_width'], MagicNumber['thumbnail_height'], self.width, self.height)
+ {:src => self.url, :width => tw, :height => th}
+ end
+
def copy_data(op)
attr = {:width => op.width, :height => op.height, :ext => op.ext, :filesize => op.filesize,
- :original_picture_id => op.id, :artist_id => op.artist_id
+ :original_picture_id => op.id, :artist_id => op.artist_id, :md5 => op.md5
}
self.attributes = attr
end