Skip to content

Commit

Permalink
Fix for #22 (No 404 http code when the image doesn't exist)
Browse files Browse the repository at this point in the history
  • Loading branch information
datazuul committed Nov 30, 2018
1 parent d7e71dc commit ee6f526
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import de.digitalcollections.iiif.hymir.image.business.api.ImageSecurityService;
import de.digitalcollections.iiif.hymir.image.business.api.ImageService;
import de.digitalcollections.iiif.hymir.model.exception.InvalidParametersException;
import de.digitalcollections.iiif.hymir.model.exception.ResourceNotFoundException;
import de.digitalcollections.iiif.hymir.model.exception.UnsupportedFormatException;
import de.digitalcollections.iiif.model.image.ImageApiProfile;
import de.digitalcollections.iiif.model.image.ImageApiSelector;
Expand All @@ -16,6 +15,7 @@
import de.digitalcollections.model.api.identifiable.resource.MimeType;
import de.digitalcollections.model.api.identifiable.resource.enums.FileResourcePersistenceType;
import de.digitalcollections.model.api.identifiable.resource.exceptions.ResourceIOException;
import de.digitalcollections.model.api.identifiable.resource.exceptions.ResourceNotFoundException;
import de.digitalcollections.turbojpeg.imageio.TurboJpegImageReadParam;
import de.digitalcollections.turbojpeg.imageio.TurboJpegImageReader;
import java.awt.Dimension;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.digitalcollections.iiif.hymir.image.business.api;

import de.digitalcollections.iiif.hymir.model.exception.InvalidParametersException;
import de.digitalcollections.iiif.hymir.model.exception.ResourceNotFoundException;
import de.digitalcollections.iiif.hymir.model.exception.UnsupportedFormatException;
import de.digitalcollections.iiif.model.image.ImageApiProfile;
import de.digitalcollections.iiif.model.image.ImageApiSelector;
import de.digitalcollections.model.api.identifiable.resource.exceptions.ResourceNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.time.Instant;
Expand All @@ -13,15 +13,16 @@
* Service providing image processing functionality.
*/
public interface ImageService {

default Instant getImageModificationDate(String identifier) throws ResourceNotFoundException {
return null;
}

void readImageInfo(String identifier, de.digitalcollections.iiif.model.image.ImageService info)
throws UnsupportedFormatException, UnsupportedOperationException, ResourceNotFoundException, IOException;
throws UnsupportedFormatException, UnsupportedOperationException, ResourceNotFoundException, IOException;

void processImage(String identifier, ImageApiSelector selector, ImageApiProfile profile, OutputStream os)
throws InvalidParametersException, UnsupportedOperationException, UnsupportedFormatException,
ResourceNotFoundException, IOException;
throws InvalidParametersException, UnsupportedOperationException, UnsupportedFormatException,
ResourceNotFoundException, IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import de.digitalcollections.commons.springboot.metrics.MetricsService;
import de.digitalcollections.iiif.hymir.image.business.api.ImageService;
import de.digitalcollections.iiif.hymir.model.exception.InvalidParametersException;
import de.digitalcollections.iiif.hymir.model.exception.ResourceNotFoundException;
import de.digitalcollections.iiif.hymir.model.exception.UnsupportedFormatException;
import de.digitalcollections.iiif.model.image.ImageApiProfile;
import de.digitalcollections.iiif.model.image.ImageApiSelector;
import de.digitalcollections.iiif.model.image.ResolvingException;
import de.digitalcollections.iiif.model.jackson.IiifObjectMapper;
import de.digitalcollections.model.api.identifiable.resource.exceptions.ResourceNotFoundException;
import java.awt.Dimension;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -83,8 +83,7 @@ public ResponseEntity<byte[]> getImageRepresentation(
@PathVariable String size, @PathVariable String rotation,
@PathVariable String quality, @PathVariable String format,
HttpServletRequest request, HttpServletResponse response, WebRequest webRequest)
throws UnsupportedFormatException, UnsupportedOperationException, IOException, InvalidParametersException,
ResourceNotFoundException {
throws UnsupportedFormatException, UnsupportedOperationException, IOException, InvalidParametersException, ResourceNotFoundException {
HttpHeaders headers = new HttpHeaders();
String path;
if (request.getPathInfo() != null) {
Expand Down

This file was deleted.

0 comments on commit ee6f526

Please sign in to comment.