Child pages
  • JSImage

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay: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.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{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]\(property) Gets the description of a metadata property from the image.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#getMetaDataObject]\(property) 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:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=flip-Number}{tr:id=name}{td}h6.flip{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSImage]{span}{span:style=font-weight: bold;}flip{span}{span}\(type){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Flips the image verticaly (type param=0) or horizontaly (type param=1). A new JSImage is returned.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} type {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSImage]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSImage
Table Cell (td)
#flip(type)
Flips the image verticaly (type param=0) or horizontaly (type param=1).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getContentType()
Gets the contenttype (image/jpeg) of this image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
#getData()
Gets the bytes of this image, so that they can be saved to disk or stored the database.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getHeight()
Gets the height of this image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getMetaDataDescription(property)
Gets the description of a metadata property from the image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getMetaDataObject(property)
Gets the real object of a metadata property from the image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
#getMetaDataProperties()
Gets the available metadata properties from the image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getWidth()
Gets the width of this image.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSImage
Table Cell (td)
#resize(width, height)
Resizes the image to the width/height given, keeping aspect ratio.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSImage
Table Cell (td)
#rotate(degrees)
Rotates the image the number of degrees that is given.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idflip-Number
Table Row (tr)
idname
Table Cell (td)
flip
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSImage
Span
stylefont-weight: bold;
flip
Span
(type)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Flips the image verticaly (type param=0) or horizontaly (type param=1). A new JSImage is returned.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} type
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSImage
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getContentType}{tr:id=name}{td}h6.getContentType{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getContentType{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the contenttype (image/jpeg) of this image.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetContentType
Table Row (tr)
idname
Table Cell (td)
getContentType
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getContentType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the contenttype (image/jpeg) of this image.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.
getContentType(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getData}{tr:id=name}{td}h6.getData{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}byte[]{span}{span:style=font-weight: bold;}getData{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the bytes of this image, so that they can be saved to disk or stored the database.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
getContentType();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetData
Table Row (tr)
idname
Table Cell (td)
getData
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
getData
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the bytes of this image, so that they can be saved to disk or stored the database.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHeight}{tr:id=name}{td}h6.getHeight{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getHeight{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the height of this image.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetHeight
Table Row (tr)
idname
Table Cell (td)
getHeight
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getHeight
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the height of this image.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMetaDataDescription-String}{tr:id=name}{td}h6.getMetaDataDescription{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getMetaDataDescription{span}{span}\(property){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the description of a metadata property from the image. Currently only jpg is supported.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} property {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMetaDataDescription-String
Table Row (tr)
idname
Table Cell (td)
getMetaDataDescription
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getMetaDataDescription
Span
(property)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the description of a metadata property from the image. Currently only jpg is supported.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} property
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMetaDataObject-String}{tr:id=name}{td}h6.getMetaDataObject{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}getMetaDataObject{span}{span}\(property){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the real object of a metadata property from the image. Currently only jpg is supported.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} property {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMetaDataObject-String
Table Row (tr)
idname
Table Cell (td)
getMetaDataObject
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getMetaDataObject
Span
(property)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the real object of a metadata property from the image. Currently only jpg is supported.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} property
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMetaDataProperties}{tr:id=name}{td}h6.getMetaDataProperties{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]\[]{span}{span:style=font-weight: bold;}getMetaDataProperties{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the available metadata properties from the image. Currently only jpg is supported.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMetaDataProperties
Table Row (tr)
idname
Table Cell (td)
getMetaDataProperties
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getMetaDataProperties
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the available metadata properties from the image. Currently only jpg is supported.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getWidth}{tr:id=name}{td}h6.getWidth{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getWidth{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Gets the width of this image.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetWidth
Table Row (tr)
idname
Table Cell (td)
getWidth
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getWidth
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the width of this image.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var image = plugins.images.getImage(byteArray_or_file);
var width = image.getWidth();
var height = image.getHeight();
var contentType = image.getContentType();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idresize-Number_Number
}{
Table Row (tr)
:
id
=
name
}{td}h6.resize{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
resize
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
JSImage
]{span}{span:style=
Span
stylefont-weight:
bold;
}
resize
{span}{span}\(width, height){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Resizes the image to the width/height given, keeping aspect ratio. A new JSImage is returned.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} width \{[Number]} height {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSImage]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Span
(width, height)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Resizes the image to the width/height given, keeping aspect ratio. A new JSImage is returned.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} width
{Number} height
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSImage
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=rotate-Number}{tr:id=name}{td}h6.rotate{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSImage]{span}{span:style=font-weight: bold;}rotate{span}{span}\(degrees){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Rotates the image the number of degrees that is given. A new JSImage is returned.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} degrees {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSImage]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idrotate-Number
Table Row (tr)
idname
Table Cell (td)
rotate
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSImage
Span
stylefont-weight: bold;
rotate
Span
(degrees)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Rotates the image the number of degrees that is given. A new JSImage is returned.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} degrees
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSImage
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)