ios 在服务器上将 HEIF (.heic) 转换为 JPEG?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45460611/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:22:31  来源:igfitidea点击:

Convert HEIF (.heic) to JPEG on a server?

iosimagemagickjpeghevcheif

提问by Christian

Apple has introduced a new image format in iOS 11 called HEIF(.heic file extension). I know you can export images as JPG from iOS devices, but I want to upload the HEIC-files to my server and convert them there to JPEG files that can be shown on all other devices.

Apple 在 iOS 11 中引入了一种新的图像格式,称为HEIF(.heic 文件扩展名)。我知道您可以从 iOS 设备将图像导出为 JPG,但我想将 HEIC 文件上传到我的服务器并将它们转换为可以在所有其他设备上显示的 JPEG 文件。

Can anyone recommend a good and efficient way to achieve this?

任何人都可以推荐一种良好而有效的方法来实现这一目标吗?

ANSWER:

Since this question has been closed, I will edit in my answer here for the rest of you. We now use this library for converting HEIC to JPEG: https://github.com/monostream/tifig

Also ImageMagick now support converting HEIC to JPEGthanks to a fork from @toshic

Thank you to @monostreamand @toshicfor your great contributions!

回答:

由于此问题已关闭,因此我将在此处为其他人编辑我的答案。我们现在使用这个库将 HEIC 转换为 JPEG:https: //github.com/monostream/tifig

此外ImageMagick的现在支持转换到HEIC JPEG多亏了从@toshic叉子

感谢@monostream@toshic做出的巨大贡献!

EDIT1: Edited the wording of the question to be more specific and meet SO guidelines

EDIT1:编辑问题的措辞,使其更具体并符合 SO 准则

EDIT2: Added answer since this topic is now closed :/

EDIT2:由于本主题现已关闭,因此添加了答案:/

回答by Eric Jensen

It's complicated because iOS 11 is actually storing tiles of HEVC encoded images in a HEIF container, but there's a demo using the nokia lib to extract them all, ffmpeg to decode them and then stitching them into a single jpeg with imagemagick in the heiftest repo linked from corrupted HEIC tile when converting to JPEG

这很复杂,因为 iOS 11 实际上将 HEVC 编码的图像块存储在 HEIF 容器中,但是有一个演示使用诺基亚库来提取它们,ffmpeg 对它们进行解码,然后在链接的 heiftest 存储库中使用 imagemagick 将它们拼接成单个 jpeg从转换为 JPEG 时损坏的 HEIC 磁贴

We also have a working one you can use by cloning https://github.com/pushd/heifand then:

我们还有一个可用的,您可以通过克隆https://github.com/pushd/heif来使用,然后:

cmake CMakeLists.txt && make && Bins/heiftojpeg test_001.heic test_001.jpg

回答by monday

CloudConvert supports to convert these HEIC files to JPG: https://cloudconvert.com/heic-to-jpg. They also have an APIwith PHP/node.js/Python SDKs.

CloudConvert 支持将这些 HEIC 文件转换为 JPG:https://cloudconvert.com/heic-to-jpg 。他们还有一个带有 PHP/node.js/Python SDK的API

回答by bhansa

There is no such library available right now for image conversion on a server for HEIF to JPEG, ImageMagick doesn't have support for that till now.

目前没有这样的库可用于在服务器上将 HEIF 图像转换为 JPEG,ImageMagick 到目前为止不支持。

The only way you can do this by exporting your images from your device, that should produce a JPEG image.

您可以通过从设备导出图像来执行此操作的唯一方法是生成 JPEG 图像。

Nokiahas a HEIFreader javascript implementation which you can have a look at: Nokiatech heif

诺基亚有一个HEIF阅读器 javascript 实现,您可以查看:Nokiatech heif

Alternate: You can try this websiteif this works.

替代方法:如果可行,您可以试试这个网站

Feature Request for ImageMagick

ImageMagick 的功能请求