提示コードですがImageMagicのMagic++ライブライを用いて.heic(iPhoneで撮影した写真)
ファイルを.jpeg
に変換したいのですが//ここです
のコード部で以下のエラーコードが表示されるのですがこれはどう対処したらいいのでしょか?リファレンスを見たりしましたが原因がわかりません。
参考サイト:https://imagemagick.org/Magick++/
エラーコード
Unsupported feature: Unsupported codec
ソースコード
cpp
1#include <iostream> 2#include "Magick++/Image.h" 3#include "libheif/heif.h" 4 5int main(int argc, char const* argv[]) 6{ 7 heif_context* ctx = heif_context_alloc(); 8 heif_context_read_from_file(ctx, "image.HEIC", nullptr); 9 10 // get a handle to the primary image 11 heif_image_handle* handle; 12 heif_context_get_primary_image_handle(ctx, &handle); 13 14 // decode the image and convert colorspace to RGB, saved as 24bit interleaved 15 heif_image* img; 16 try 17 { 18 heif_error err = heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB,nullptr); 19 std::cout << err.message << std::endl; //ここです。 20 } 21 catch (std::exception e) 22 { 23 printf(e.what()); 24 } 25 int stride = 0; 26 //const uint8_t* data = heif_image_get_plane_readonly(img, heif_channel_interleaved, &stride); 27 28 heif_error err = heif_context_write_to_file(ctx, "test.jpeg"); 29 std::cout << err.message << std::endl; 30 31 return 0; 32} 33
あなたの回答
tips
プレビュー