ResizeImage
Mon 01 January 2018Syntax
ResizeImage(URL.source_URL, URL.dest_URL, array_of_sizes [, type][, aspect_ratio])
Description
Use the ResizeImage function to create one or more resized copies of the source image. Depending on the image source, ResizeImage supports the following image formats only:
-
Record field: BMP and JPEG.
-
File system folder: BMP, GIF, JPEG, and PNG.
The resized images can be created in file system folder or in a database table. When the destination location is a file system folder, then the name of the resized image is created from the source image file name along with the resize dimensions. For example, if file1.jpg is resized to 40 x 60 pixels, then the resulting file name would be file14060.jpg. If the same file is resized to 10%. the resulting file name would be file110.jpg.
When a database table is specified as the destination location, the PS_PT_IMG_TMPSTORE table is used to temporarily store the images instead of the specified database table. Using the return code of the function invocation as a key value, your application must retrieve the resized images from the PS_PT_IMG_TMPSTORE table.
Column Name |
Data Type |
Description |
---|---|---|
PT_IMG_UUID* |
Nbr |
The return value of the ResizeImage method. All the resized images stored in database for a specific invocation are stored with this identifier. |
PT_IMG_FILESEQNO* |
Nbr |
The sequence number for multiple resizings of the same source image file. |
PT_IMG_WIDTH* |
Nbr |
The image width in pixels. |
PT_IMG_HEIGHT* |
Nbr |
The image height in pixels. |
PT_IMG_IMGNAME |
Char |
The file name of the source image. |
PT_IMG_IMGDATA |
Long |
The image data for the re-sized image. |
PSIMAGEVER |
Nbr |
The image version. |
LAST_UPDATE_DTTM |
DtTm |
The last update timestamp. |
OPRID |
Char |
The operator ID |
* Represents a key field. The composite key for a specific resized image would consist of: PT_IMG_UUID + PT_IMG_FILESEQNO + PT_IMG_WIDTH + PT_IMG_HEIGHT + PT_IMG_IMGNAME.
Three image manipulation testing pages provide a sample application that allows an administrator to predefine resize dimensions (Image Size page), predefine groupings of dimensions (Image Group page), and then test the usage of these predefined groups for resizing images (Test Utility page). See for more information.
Parameters
Field or Control |
Definition |
---|---|
URL. source_URL |
Specifies the location of the source image (or images) as a URL object. The source location can be either a database record or a folder on the application serverâs file system containing one or more image files. When the URL object specifies a database record, you must define three URL properties: to specify the column name from which image data has to be read (), the column name from which the image name has to be taken (), and destination image type ().
|
URL. dest_URL |
Specifies the location of the resized image (or images) as a URL object. The destination location can be either a database record or a folder on the application serverâs file system. Important! When the destination location is specified as a database record, the PS_PT_IMG_TMPSTORE table is used to temporarily store the images instead of the specified record. Using the return code of the function invocation as a key value, your application must retrieve the resized images from the PS_PT_IMG_TMPSTORE table. See the âDescriptionâ for more information on using the PS_PT_IMG_TMPSTORE table. |
array_of_sizes |
Specifies resize dimensions as an array of integer. The contents of the array are retrieved in pairs or one-by-one depending on the value of the type parameter. In addition, the array must be terminated with two 0s or one 0, depending on the type parameter.
Important! Oracle recommends that you do not resize images to dimensions larger than the original size or to a percentage larger than 100%. |
type |
Specifies an optional numeric value indicating how to retrieve the values from the array_of_sizes array:
|
aspect_ratio |
Specifies an optional Boolean value indicating whether to maintain the aspect ratio of the source image:
True is the default value. In addition, the aspect_ratio parameter is ignored when the type parameter is 1 (%Resize_ByPercentage). |
Returns
An Integer value representing the unique identifier for the resize invocation. A negative number indicates that the function terminated with an error.