記事一覧

Android - jpg color mode

It may depend on decoding attribute setting but in my case jpg files with CMYK color mode caused an error in runtime.

I came across this error while I was testing the method for getting resource ID dynamically, and I had no doubt that it's the problem about getting resource ID, so it took a few hours until notice that...

jpgファイルのカラーモードがCMYKだと実行時にエラーで落ちるようです。デコードの際のオプション設定をちゃんとすれば読めるのかもしれないけど、ひとまずそういうこともありましたよ、ということで。

で、この現象に出くわしたのがリソースIDを動的に取ってくるやり方を実験してた時で、なのでID取得が原因と思い込んでそれ(CMYKモードが読めてない)に気づくのに数時間要してしまったというお話し・・。