{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSImage]{td}{td}[#flip]\(type)
Flips the image verticaly (type param=0) or horizontaly (type param=1).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getContentType]\()
Gets the contenttype (image/jpeg) of this image.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#getData]\()
Gets the bytes of this image, so that they can be saved to disk or stored the database.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getHeight]\()
Gets the height of this image.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getMetaDataDescription]\()
Gets the description of a metadata property from the image.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#getMetaDataObject]\()
Gets the real object of a metadata property from the image.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getMetaDataProperties]\()
Gets the available metadata properties from the image.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getWidth]\()
Gets the width of this image.{td}{tr}{tbody}{tbody}{tr}{td}[JSImage]{td}{td}[#resize]\(width, height)
Resizes the image to the width/height given, keeping aspect ratio.{td}{tr}{tbody}{tbody}{tr}{td}[JSImage]{td}{td}[#rotate]\(degrees)
Rotates the image the number of degrees that is given.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=2E913C4D-D82F-4409-BE6A-00788E63F9C0}{tr:id=name}{td}h6.flip{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSImage]{span}{span:id=iets|style=float: left; font-weight: bold;}flip{span}{span:id=iets|style=float: left;}\(type){span}{td}{tr}{tr:id=des}{td}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_des|text=|trigger=button}{sub-section}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_des|trigger=none|class=sIndent}Flips the image verticaly (type param=0) or horizontaly (type param=1). A new JSImage is returned.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_prs|trigger=none}type
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_ret|text=|trigger=button}{sub-section}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_ret|trigger=none|class=sIndent}[JSImage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_see|text=|trigger=button}{sub-section}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_see|text=|trigger=button}{sub-section}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_sam|text=|trigger=button}{sub-section}{sub-section:2E913C4D-D82F-4409-BE6A-00788E63F9C0_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.flip(0);//flip vertically
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A}{tr:id=name}{td}h6.getContentType{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getContentType{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_des|text=|trigger=button}{sub-section}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_des|trigger=none|class=sIndent}Gets the contenttype (image/jpeg) of this image.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_ret|text=|trigger=button}{sub-section}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_see|text=|trigger=button}{sub-section}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_see|text=|trigger=button}{sub-section}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_sam|text=|trigger=button}{sub-section}{sub-section:0DD1B6F6-8653-4C3E-9061-7B4BF4BB356A_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=044878FD-13C7-44FE-9EB5-7868C71FCEE0}{tr:id=name}{td}h6.getData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}getData{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_des|text=|trigger=button}{sub-section}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_des|trigger=none|class=sIndent}Gets the bytes of this image, so that they can be saved to disk or stored the database.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_ret|text=|trigger=button}{sub-section}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_see|text=|trigger=button}{sub-section}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_see|text=|trigger=button}{sub-section}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_sam|text=|trigger=button}{sub-section}{sub-section:044878FD-13C7-44FE-9EB5-7868C71FCEE0_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.resize(200,200);//resizes it to 200,200
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6A6AAB5B-4D32-4815-B769-9A0BE2113C39}{tr:id=name}{td}h6.getHeight{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getHeight{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_des|text=|trigger=button}{sub-section}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_des|trigger=none|class=sIndent}Gets the height of this image.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_ret|text=|trigger=button}{sub-section}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_see|text=|trigger=button}{sub-section}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_see|text=|trigger=button}{sub-section}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_sam|text=|trigger=button}{sub-section}{sub-section:6A6AAB5B-4D32-4815-B769-9A0BE2113C39_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=29695BB7-57C1-486C-8005-925CE2DDC121}{tr:id=name}{td}h6.getMetaDataDescription{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getMetaDataDescription{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_des|text=|trigger=button}{sub-section}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_des|trigger=none|class=sIndent}Gets the description of a metadata property from the image. Currently only jpg is supported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_ret|text=|trigger=button}{sub-section}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_see|text=|trigger=button}{sub-section}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_see|text=|trigger=button}{sub-section}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_sam|text=|trigger=button}{sub-section}{sub-section:29695BB7-57C1-486C-8005-925CE2DDC121_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=39EE977E-68EE-4054-B89F-5C8A452F7386}{tr:id=name}{td}h6.getMetaDataObject{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}getMetaDataObject{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_des|text=|trigger=button}{sub-section}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_des|trigger=none|class=sIndent}Gets the real object of a metadata property from the image. Currently only jpg is supported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_ret|text=|trigger=button}{sub-section}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_ret|trigger=none|class=sIndent}Object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_see|text=|trigger=button}{sub-section}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_see|text=|trigger=button}{sub-section}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_sam|text=|trigger=button}{sub-section}{sub-section:39EE977E-68EE-4054-B89F-5C8A452F7386_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B4AA41B5-67A8-4FF7-8DC7-702B058EEB27}{tr:id=name}{td}h6.getMetaDataProperties{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getMetaDataProperties{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_des|text=|trigger=button}{sub-section}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_des|trigger=none|class=sIndent}Gets the available metadata properties from the image. Currently only jpg is supported.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_ret|text=|trigger=button}{sub-section}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_see|text=|trigger=button}{sub-section}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_see|text=|trigger=button}{sub-section}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_sam|text=|trigger=button}{sub-section}{sub-section:B4AA41B5-67A8-4FF7-8DC7-702B058EEB27_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=05FEB35F-9765-4366-9D85-D63A500ACAD1}{tr:id=name}{td}h6.getWidth{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getWidth{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_des|text=|trigger=button}{sub-section}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_des|trigger=none|class=sIndent}Gets the width of this image.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_ret|text=|trigger=button}{sub-section}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_see|text=|trigger=button}{sub-section}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_see|text=|trigger=button}{sub-section}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_sam|text=|trigger=button}{sub-section}{sub-section:05FEB35F-9765-4366-9D85-D63A500ACAD1_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4C97523A-352F-471B-ACDB-10E039FF270E}{tr:id=name}{td}h6.resize{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSImage]{span}{span:id=iets|style=float: left; font-weight: bold;}resize{span}{span:id=iets|style=float: left;}\(width, height){span}{td}{tr}{tr:id=des}{td}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_des|text=|trigger=button}{sub-section}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_des|trigger=none|class=sIndent}Resizes the image to the width/height given, keeping aspect ratio. A new JSImage is returned.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_prs|trigger=none}width
height
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_ret|text=|trigger=button}{sub-section}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_ret|trigger=none|class=sIndent}[JSImage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_see|text=|trigger=button}{sub-section}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_see|text=|trigger=button}{sub-section}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_sam|text=|trigger=button}{sub-section}{sub-section:4C97523A-352F-471B-ACDB-10E039FF270E_sam|class=sIndent|trigger=none}{code:language=javascript}
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.resize(200,200);//resizes it to 200,200
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=853F9A4A-666B-4E78-AF8E-72F142EE172F}{tr:id=name}{td}h6.rotate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSImage]{span}{span:id=iets|style=float: left; font-weight: bold;}rotate{span}{span:id=iets|style=float: left;}\(degrees){span}{td}{tr}{tr:id=des}{td}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_des|text=|trigger=button}{sub-section}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_des|trigger=none|class=sIndent}Rotates the image the number of degrees that is given. A new JSImage is returned.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_prs|trigger=none}degrees
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_ret|text=|trigger=button}{sub-section}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_ret|trigger=none|class=sIndent}[JSImage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_see|text=|trigger=button}{sub-section}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_see|text=|trigger=button}{sub-section}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_sam|text=|trigger=button}{sub-section}{sub-section:853F9A4A-666B-4E78-AF8E-72F142EE172F_sam|class=sIndent|trigger=none}{code:language=javascript}
Div
style
display:none
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.flip(0);//flip vertically
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
Table Row (tr)
class
lastDetailRow
Table Cell (td)
Table Body (tbody)
id
getData
Table Row (tr)
id
name
Table Cell (td)
getData
Table Row (tr)
id
sig
Table Cell (td)
Span
style
margin-right: 5px;
byte[]
Span
style
font-weight: bold;
getData
Span
()
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Gets the bytes of this image, so that they can be saved to disk or stored the database.
Table Row (tr)
id
ret
Table Cell (td)
Returns
Div
class
sIndent
byte[]
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.resize(200,200);//resizes it to 200,200
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
// get the available metadata properties from the image, currently only jpg is supported
var propertiesArray = image.getMetaDataProperties();
for(var i=0;i<propertiesArray.length;i++)
{
var property = propertiesArray[i]
application.output("property: " + property);
application.output("description (string): " + image.getMetaDataDescription(property))
application.output("real object: " + image.getMetaDataObject(property))
}
// Thumbnail data is stored under property 'Exif - Thumbnail Data', extract that and set it in a dataprovider
thumbnail = image.getMetaDataObject("Exif - Thumbnail Data"); // gets thumbnail data from the image
var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.resize(200,200);//resizes it to 200,200
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes
var image = plugins.images.getImage(byteArray_or_file_or_filename);//loads the image
image = image.rotate(90);//rotate the image 90 degrees
var bytes = image.getData();//gets the image bytes
plugins.file.writeFile('filename',bytes);//saves the image bytes