On Wed, 26 Oct 2005, Felix Röthenbacher wrote:

Hi Jann

Jann Forrer wrote:
Hi

I did modify the upload uecase a little bit to save the height and the
width of a image in the metadata. For the design of the site this
information might be useful.

Applying the change  respective entry in the <image>.gif.meta
looks like (lenya-1.2.X):

....
<dc:format>image/gif 505 x 48 pixels</dc:format>
...

Does that make sense or do you have other ideas where this information
should be stored?

dc:format is the right place for dimension information according to the
spec.

Your are right but it would be a little bit easier to retrieve this information if you have something like dc:imagewidth ...... (but as you said dc:format is the right place).


How do you get the image size information? What image formats are
supported?


if (canReadMimeType(mimeType)) {
                BufferedImage input = ImageIO.read(assetFile);
                width = input.getWidth();
                height = input.getHeight();

public static boolean canReadMimeType(String mimeType) {
      Iterator iter = ImageIO.getImageReadersByMIMEType(mimeType);
      return iter.hasNext();
}

I am not sure what image format are supported but ceratinly gif, jpge and png.

Jann

---------------------------------------------------------------
Jann Forrer
Informatikdienste
Universität Zürich
Winterthurerstr. 190
CH-8057 Zuerich

oooO   mail:  [EMAIL PROTECTED]
(  )   phone: +41 44 63 56772
 \ (   fax:   +41 44 63 54505
  \_)  http://www.id.unizh.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to