Removed call to obsolete service method
authorn.hoffmann <n.hoffmann@localhost>
Thu, 9 Jun 2011 09:37:39 +0000 (09:37 +0000)
committern.hoffmann <n.hoffmann@localhost>
Thu, 9 Jun 2011 09:37:39 +0000 (09:37 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.java

index c155efba1c09014f7a51bebb5ad9f1984f4d892e..2cff332fc41350d801fe295d5ef96ceac8202bc0 100644 (file)
@@ -96,19 +96,15 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
                        return;
                }
                try {
-                       
-                       Integer size = CdmStore.getService(IMediaService.class).getImageSize(uri, 10000);                       
-                       
-                       if(size != null){
-                               text_size.setText(FileUtils.byteCountToDisplaySize(size));
-                               getEntity().setSize(size);
-                       }
-                       
-                       
+                                               
                        try {
                                
                                ImageInfo imageInfo = ImageInfo.NewInstanceWithMetaData(uri, 10000);
                                        
+                               text_size.setText(FileUtils.byteCountToDisplaySize(imageInfo.getLength()));
+                               // KLUDGE this is not save for very large files. I don't think we will handle such large files in the near future
+                               getEntity().setSize((int) imageInfo.getLength());
+                               
                                text_height.setInteger(imageInfo.getHeight());
                                getEntity().setHeight(imageInfo.getHeight());