-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Imagick::readImageFile NEF filehandle detected as TIFF #685
Comments
I'm encountering the same issue with NEF pictures within the Memories app of Nextcloud. |
Hi, I won't be able to fix this in Imagick. Imagick is a thin wrapper around ImageMagick and so Imagick doesn't do any of the image processing itself. I'd suggest reporting the issue at https://github.com/ImageMagick/ImageMagick But also:
If those fail, and the ImageMagick maintainers don't do anything, then post an example file here (I guess zipped up to get past githubs upload rules). |
@Danack Thanks for the reply, I'll look into your recommendations when I have some free time. |
Try to read an open filehandle results in imagemagick detect the fiel as a TIFF and then only reads the low-res preview.
`
$filename='_X000001.NEF';
$preview='_X000001.jpg'
$fh = fopen("/src-dir/$filename", "r");
$im->readImageFile($fh);
$imageinfo = $im->identifyImage();
$im->resizeImage(1024, 768, Imagick::FILTER_LANCZOS, 1);
$im->setImageFormat('jpg');
$im->writeImage("/dst-dir/$preview");
$im->clear();
$im->destroy();
// do other stuff with source file
fclose($fh);
`
results in $imageinfo showing format = "TIFF (Tagged Image File Format)"
and the output jpg is super blurry as it end being scaled up from the NEF preview a tiny 160x120px, instead of the full size NEF 3280x4928
The text was updated successfully, but these errors were encountered: