Closed otymartin closed 8 years ago
What is your image type (PNG, JPEG, GIF, ...)? Now DataCache just support PNG and JPEG.
If it is PNG file, please user param format when you write image
DataCache.instance.write(image: image, forKey: sticker.downloadURL, format: .png)
@huynguyencong Thanks I actually just figured it out and was about to document my solution.
But yes it was a PNG
format. By default if no format
is specified, I noticed you cache the image as a JPG
which will strip out any PNG
attributes such as masks.
Thanks :)
You're welcome :)
@huynguyencong Im using this library to cache stickers for
iMessage Extension Sticker App
My images are png's with circle masks around them.When i download and display them fresh from my database, the masks remain. But when I load from cache, there is no longer a mask. Its a square image with a white background.
How can I fix this?