Throw proper exception if we can't get the mimetype for a preview. Catch
it later on so we can just return a not found for the preview.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
For legacy reasons we stored all the previews with a png extention.
However we did not put png data in them all the time.
This caused the preview endpoints to always report that a preview is a
png file. Which was a lie.
Since we abstract away from the storage etc in the previewmanager. There
is no need anymore to store them as .png files and instead we can use
the actual file extention.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
During preview generation if we provide an invalid JPG file the system
errors out with a PHP Fatal Error. Now we can't catch Fatal Errors (in
5.6). I suspect that exif_imagetype to fall back to the extention.
However a valid jpg file has a size. So we request the size of the image
and just drop out if that returns false.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
As discussed we move all old style classes (OC_FOO_BAR) to legacy.
Then from there we can evaluate the need to convert them back or if they
can be fully deprecated/deleted.