Elite Observer

PictureResolution returns -1 for getSize()


I'm currently working on a script, which is verifying media types set for "Media" elements. Especially the validation of pictures is tricky.

To verify a picture i use the following logic:

/* This is NOT the original code. The example code shall only illustrate the logic */

if (mediaType.equals(Media.PICTURE)) {

     extension = pictureResolution.getExtension();

     if ( extension != null && myPictureFileExtensionList.contains(extension)) {

          size = pictureResolution.getSize();

          ....... ...... .....



The script is logging some elements as not valid due to size = -1 see example in beanshell console:


During investigations I've found out, that there is a valid picture set for the "original" (initial) resolution!


Export of the media file leads to the correct image, see below:


Now my questions:

1. Is this a bug in FS 4.2.488, which is already fixed in 5.1.106 or higher?

2. If my validation logic is not recommended, are there any other capabilities via API?

Thanks in advance!

Original picture file added.

0 Kudos
3 Replies
Crownpeak employee

Your screenshot is showing a complete black thumbnail - this is an indication that FirstSpirit 4.2.488 isn't capable of reading the image data correctly. Chances are high that this has improved with an up-to-date version of FirstSpirit. You could upload the picture here so that someone could check this.

0 Kudos

Hello Peter,

I've attached the original file. Due to the meta informations, the image was exported out of Photoshop CS2. It's curious that the compression is set to uncompressed. Maybe it's not a jpg!? meta.png

0 Kudos


I imported the attached image into our demo project Mithras Energy (FS version: 4.2.499.59728).

The thumbnail looked fine, but I got the following exception:

FSVersion=4.2.499.59728#-1;JDK=1.7.0_51 32bit Oracle Corporation;OS=Windows 7 6.1 x86;Date=07.08.2014 11:47:39 javax.imageio.IIOException: Unsupported Image Type

     at de.espirit.common.imaging.ThumbnailProducer.loadImageSubSample(

     at de.espirit.common.imaging.ThumbnailProducer.load(



     at de.espirit.firstspirit.client.gui.util.GuiUtil$

     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

     at java.util.concurrent.ThreadPoolExecutor$ Source)

     at Source)

Caused by: javax.imageio.IIOException: Unsupported Image Type

     at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)

     at Source)

     at de.espirit.common.imaging.ThumbnailProducer.loadImageSubSample(

     ... 7 more

So I would ask you to contact our Helpdesk team. They can take a closer look.

Best regards