How to calculate Image width and height?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2016 02:31 AM
Hello,
I have a requirement in which we have to validate image width and height of the image file attached to the catalog request.
There is similar functionality in Images(db_image) table OOB. if we upload any image it directly calculates image width and height but I am unable to trace the code which is performing this functionality.
Please suggest an approach or possible solution to perform this activity.
Note: Our instance is in Fuji
Best Regards,
Rajesh M.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2016 09:32 PM
Anybody please? thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 12:57 AM
Hello spartacus,
I was away for a time, so here comes my delayed response:
**question: what is 'attachments' ur referring to? is that the value of picture or the image filename? cos I cannot pull the picture name from the filed 'picture' in 'cmdb_hardware_product_model' table
-> attachments is the variable in my script that is a table of objects.
result.height = ga_att.image_height;
result.width = ga_att.image_width;
result.size = ga_att.size_bytes;
result.file_name = ga_att.file_name;
attachments.push(result)
So use it like:
var imageDetails = "Width: " + attachments[0].width + "Height: " + attachments[0].height;
g_form.setValue('short_description', imageDetails);
Regards,
Michal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2016 10:09 PM
Hi Michal,
Thanks for the reply, appreciate it. I will try it then let you know after.
rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 03:37 AM
Hello Daniel,
No, you don't need to do that, but remember that:
Note: the result of this query is empty, without the roles sys_attachment.
That is because you need a role sys_attachment that admin DOES NOT overwrite.
Reagrds,
Michal
