简体   繁体   中英

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. 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:) . 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. Anyone have an idea why this is happening? I tried a PNG from the Google tile servers and it worked fine. My PNGs are being generated by a script that uses 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. In ImageMagick, I just had to add -depth 8 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM