Downloading images from Cloudinary in Android
I'm trying to figure out what the optimal workflow would be for an image transformation process in which a transformed image is again uploaded to another API.
According to Cloudinary (http://cloudinary.com/documentation/image_transformations#resizing_and_cropping_images), I can access uploaded images with the following kind of URL structure and also simultaneously transform them: ``http://res.cloudinary.com/demo/image/upload/w_200,h_100/sample.jpg``.
Assuming that sample.jpg already exists in Cloudinary, the provided link will fetch it with a image resize transformation already applied.
Can I simply provide this link to Picasso and turn it into a Bitmap?
Picasso.with(this)
.load("http://res.cloudinary.com/demo/image/upload/w_200,h_100/sample.jpg")
.into(new Target() {
@Override
public void onBitmapLoaded (final Bitmap bitmap, Picasso.LoadedFrom from){
/* Save the bitmap or do something with it here */
UploadBitmap(bitmap);
}
});
Also does the support forum provide code markdown? That would be really helpful. Thanks!
0
-
Hi Martin,
Your load code looks correct. Specifying the `width` and `height` in the URL will manipulate the image on-the-fly, delivering a resized image to Picasso.
And yes, the forum does support code markdown:)
0
Post is closed for comments.
Comments
1 comment