Project

General

Profile

« Previous | Next » 

Revision 46813

insert image type check.

View differences:

modules/dnet-efg/trunk/src/main/java/eu/dnetlib/efg/thumbnails/ThumbnailController.java
51 51

  
52 52

  
53 53
    @RequestMapping(value = "/ui/thumbnail/getThumbnail")
54
    public void getThumbnail(final HttpServletResponse response, @RequestParam(name = "metadataId") final String metadataId, @RequestParam(name = "imageSize") final int imageSize, @RequestParam(name = "imageType") final String type) throws Exception {
54
    public void getThumbnail(final HttpServletResponse response, @RequestParam(name = "metadataId") final String metadataId,
55
                             @RequestParam(name = "imageSize") final int imageSize, @RequestParam(name = "imageType")  String type) throws Exception {
55 56
        if (imageSize != 96 && imageSize != 250) throw new Exception("Image size not supported!");
57

  
58
        if(!type.equalsIgnoreCase("video") && !type.equalsIgnoreCase("image") && !type.equalsIgnoreCase("text")){
59
            type = "video";
60
        }
56 61
        if (objectStoresThumbnail == null) {
57 62
            createObjectStoreThumbnail();
58 63
        }

Also available in: Unified diff