[英]Google Maps SDK for iOS: don't support little endian bitmaps
I'm trying to implement a GMSTileLayer
subclass in the Google Maps for iOS SDK. 我正在尝试在iOS版Google Maps中实现
GMSTileLayer
子类。 I have a bunch of PNG images on disk that are for each tile in the tile layer, and they're loaded using UIImage(contentsOfFile:)
. 我在磁盘上有一堆用于图块层中每个图块的PNG图像,它们是使用
UIImage(contentsOfFile:)
加载的。 When I try to load the images, they don't show up, and I get this message in the log: 当我尝试加载图像时,它们没有显示,并且我在日志中收到此消息:
2015-08-22 22:50:10.663 inPin[44718:24904635] ((null)) was false: Don't support little endian bitmaps
2015-08-22 22:50:10.663 inPin[44718:24904635] ((null)) was false: Unable to create GMSGLImageTile due to bad graphics data
I didn't know that PNG images even had endianness, so I don't know where this message is coming from. 我不知道PNG图像甚至具有字节顺序,所以我不知道此消息来自何处。 Anyone have an idea why this is happening?
有人知道为什么会这样吗? I tried a PNG from the Google tile servers and it worked fine.
我从Google磁贴服务器尝试了PNG,效果很好。 My PNGs are being generated by a script that uses ImageMagick.
我的PNG由使用ImageMagick的脚本生成。
Okay, I figured it out. 好吧,我知道了。 Turns out my image had 16 bit color depth, and changing it to 8 bit made the error go away.
原来我的图像具有16位色深,将其更改为8位可使错误消失。 In ImageMagick, I just had to add
-depth 8
. 在ImageMagick中,我只需要添加
-depth 8
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.