Permanently rotating an image using Explicit API
Hi,
I've uploaded an image and then want to rotate it permanently from an image editor in my app.
And then to access the rotated image without needing to place /a_[angle] to the url every time.
I expect that it could be done with the following uploader.explicit call:
app.cloudinary.v2.uploader.explicit(publicId, { type: 'upload', eager: [ { angle: 90 } ] });
And it's expected that Explicit can return an updated image version so I don't have to wait for cache to be invalidated (editor should quickly reload the rotated image).
But after applying rotation Explicit returns the same image version.
node[9487]: { public_id: 'products/k1pelmgekdkhihooqimz',
node[9487]: version: 1512958347,
node[9487]: signature: '6b7a17063c88a5e2ddd17830c45bd34e3bec699b',
node[9487]: width: 1024,
node[9487]: height: 768,
node[9487]: format: 'jpg',
node[9487]: resource_type: 'image',
node[9487]: created_at: '2017-12-11T02:12:28Z',
node[9487]: bytes: 780831,
node[9487]: type: 'upload',
node[9487]: url: 'http://res.cloudinary.com/naturometer/image/upload/v1512958347/products/k1pelmgekdkhihooqimz.jpg',
node[9487]: secure_url: 'https://res.cloudinary.com/naturometer/image/upload/v1512958347/products/k1pelmgekdkhihooqimz.jpg',
node[9487]: eager:
node[9487]: [ { transformation: 'a_90',
node[9487]: width: 768,
node[9487]: height: 1024,
node[9487]: bytes: 288757,
node[9487]: url: 'http://res.cloudinary.com/naturometer/image/upload/a_90/v1512958347/products/k1pelmgekdkhihooqimz.jpg',
node[9487]: secure_url: 'https://res.cloudinary.com/naturometer/image/upload/a_90/v1512958347/products/k1pelmgekdkhihooqimz.jpg' } ] }
How to do this? Is the Explicit API a good solution for quick in-place image modification? Thank you.
Regards, Dmitry.
-
Hi Dimitry,
The explicit method is mainly used to perform transformations on an already existing resource eagerly before the transformation is requested on the fly
It does not change the original permanently.
If you want to perform change to an original image, it should be performed during its upload by using an incoming transformation
Hope this help.
Let me know if you have any further questions.
Thanks,
Ido
0 -
Got it, thanks!
0 -
Hi again,
I'd like to use OCR text detection plugin in my project and I've subscribed to its free plan for testing.
Some files are already uploaded to Cloudinary.
Is it possible to extract text from an existing image by executing the 'explicit' method?
As far as I understand, placing { ocr: 'adv_ocr' } parameter to the method should add 'ocr' node to its result.
But a can't see any. Here's my code:app.cloudinary.v2.uploader.explicit(
publicId, {
type: 'upload',
ocr: 'adv_ocr'
},
function(error, result) {
// ...
res.json({
// no ocr here
message: result
});
}
)here is the image:
http://res.cloudinary.com/godovod/image/upload/v1513081984/ocr/pryanikand here is the result:
https://godovod.ru/api/files/ocr?file=ocr/pryanik0 -
ok, I've managed to extract text using cloudinary.v2.api.update method.
0 -
Thanks for the update.
glad to hear its working :)
Let me know if you have any further questions.
0
Post is closed for comments.
Comments
5 comments