🐧

pyheifのピクセルサイズエラー解消

に公開

課題

Python(pyheif)でHEIC形式の画像を変換するスクリプトをひさしぶりに動かしたら以下のエラー。Python側とOS側のピクセルサイズが違うみたいなニュアンス。

エラーメッセージ

エラー: struct heif_decoding_options: wrong total size (cdef says 72, but C compiler says 88). fix it or use "...;" as the last field in the cdef for struct heif_decoding_options to make it flexible

解決

pyheifによるバイト列の計算をやめ、pillow-heif(Pillowのプラグイン)を導入しました。

Discussion