doufei5537 2014-01-13 11:22
浏览 131
已采纳

JPG仅在Android中加载

I have been resampling images via imagemagick on a windows machine. Vast majority work fine however there are one or two images that won't load on any android device. I thought it was my java app code that was broken but I can reproduce it in Chrome on the Android device too.

The images load fine on iOS/PC/Mac only just not on android. It's only 320x44 pixels in 10Kb of data and not seeing any error messages, can anyone shed some light on what I may have done (or steps I've missed) when using imagemagick to get this to work?

Here's the link to the JPG

http://gatherhelp.com/tests/corruptjpg/broken.jpg

UPDATE I've used 'Charles' to intercept the network traffic from the phone and view this request and that too shows I am indeed being delivered a white image as a response to this URL from the android.

I'm using PHP on the server but JPG files are not processed, merely straight through file served

  • 写回答

1条回答 默认 最新

  • doudaotui4297 2014-01-13 12:17
    关注

    I know it's poor form to answer your own question but just in case this helps anyone else... It appears that the issue was I converted some PSD and other files that were originally made for printing and had the CMYK color format instead of RGB.

    To find this out I used ImageMagick's Identify command and did this

       Identify -verbose broken.jpg
    

    giving

    Image: broken.jpg
      Format: JPEG (Joint Photographic Experts Group JFIF format)
      Class: DirectClass
      Geometry: 256x256+0+0
      Resolution: 250x250
      Print size: 1.024x1.024
      Units: PixelsPerInch
      Type: ColorSeparation
      Endianess: Undefined
      Colorspace: CMYK
      Depth: 8-bit
    

    This showed the colorspace was CMYK so a quick test of the other broken images showed they all had the same issue. To convert them again ImageMagick to the rescue and used

       convert broken.jpg -colorspace RGB fixed.jpg
    

    So it appears iOS/PC/Mac all support JPEGs that have CMYK but Android appears not to or at least not all CMYK images (As of Android 4.2)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误