Diamond
Diamond

Reputation: 7483

How to cache images with different names using cloudinary in Codenameone

If I use codenameone URLImage, I can specify a filename for cached images... for example, I can have MyPic_Big.jpg and MyPic_Small.jpg as images coming from the same URL and possibly with different sizes.

Is there a way to do the same using cloudinary in codenameone or the Java API?

My use case is that I want to fetch 2 different sizes of the same image using transformation. What I noticed is that if the bigger version has already been fetched, the smaller version will use that because it found the filename in storage and Vice-versa.

Upvotes: 1

Views: 143

Answers (2)

steve hannah
steve hannah

Reputation: 4716

I see that you have answered this question yourself, by adding the functionality. I have merged your support for cacheName() to allow you to explicitly set the cache name. For future reference, the example usage is here:

https://github.com/shannah/cloudinary-codenameone/blob/3ce84fedd2f8364f64885de9390fe0da4d2c2725/src/com/codename1/cloudinary/CloudinaryDemo.java#L74-L79

Download the latest release here: https://github.com/shannah/cloudinary-codenameone/releases/latest

Upvotes: 2

Nadav Ofir
Nadav Ofir

Reputation: 778

Codename has only recently introduced an integration to Cloudinary :)
More information is available on their blog-post:
https://www.codenameone.com/blog/sizing-images-just-right-with-cloudinary.html
Here's a link to their git repo:
https://github.com/shannah/cloudinary-codenameone

Furthermore, Cloudinary also provides an official and comprehensive JAVA integration.
For more information, including setup instruction and code examples, see: http://cloudinary.com/documentation/java_integration

Upvotes: 1

Related Questions