在linux / php中将RAW照片转换为JPEG [英] Convert RAW photos to JPEG in linux/php

查看:374
本文介绍了在linux / php中将RAW照片转换为JPEG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发照片上传应用,需要允许用户从相机上传原始文件(这些不是jpeg),并让服务器自动创建它们的jpeg版本。我目前安装了Imagemagick,但我认为没有办法在那里进行。

I'm working on an photo upload app and need to allow users to upload raw files from cameras (these are not jpegs) and have the server automatically create a jpeg version of them. I currently have Imagemagick installed but I don't think there is a way to do it in there.

相机一直都有新的原始格式,所以即时通讯对于那些将是相对最新的命令和命令php exec()也是一个选项。

Cameras come out with new raw formats all the time, so im looking for something that will be relativley up-to-date and command php exec() is an option too.

有没有人有什么建议进行原始转换?

Does anyone have anything to suggestion for raw conversion?

推荐答案

实际上,正如您在此列表中所看到的,ImageMagick确实支持RAW照片: http://www.imagemagick.org/script/formats.php (例如.NEF尼康照片和.CR2佳能照片)。

Actually, as you can see in this list, ImageMagick does support RAW photos: http://www.imagemagick.org/script/formats.php (e.g. .NEF nikon photos and .CR2 canon photos).

.CR2照片的示例代码:

Example code for a .CR2 photo:

$im = new Imagick( 'source.CR2' );
$im->setImageFormat( 'jpg' );
$im->writeImage( 'result.jpg' );
$im->clear();
$im->destroy();

这篇关于在linux / php中将RAW照片转换为JPEG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆