In this section, we will introduce a way to generate thumbnails for images of extension .jpg, jpeg, and .png. We will create a class called ThumbnailCreator to take care of the thumbnail creation. Figure 13.5 shows its relationship with its dependency, ImageProcessor, which is responsible for the actual image resizing and retrieving the image's actual size:
The following is how the create() method of ThumbnailCreator looks:
...@Componentpublic class ThumbnailCreator { ... public void create(FileStorage fileStorage, TempFile tempImageFile) { Assert.isTrue(tempImageFile.getFile().exists(), ...