dasch-swiss/sipi

mimetype_consistency should also work with non-image files

benjamingeer opened this issue · 2 comments

Currently. this method is implemented as SipiImage::checkMimeTypeConsistency and works only for images. It should be made more generic so that it also works for non-image files.

I think the method checkMimeTypeConsistency has to be moved out of SipiImage so it can be called for non image files.

The method should already support non-image file extendsions:

sipi/src/SipiImage.cpp

Lines 57 to 64 in 965a9e3

std::unordered_map<std::string, std::string> SipiImage::mimetypes = {{"jpx", "image/jp2"},
{"jp2", "image/jp2"},
{"jpg", "image/jpeg"},
{"jpeg", "image/jpeg"},
{"tiff", "image/tiff"},
{"tif", "image/tiff"},
{"png", "image/png"},
{"pdf", "application/pdf"}};

@lrosenth Could you give me a hand here?