Home
SQL Image Viewer online help Prev Page Prev Page
Introduction
About SQL Image Viewer
Version history
Contact us
User Guide
System requirements
Editor command selection
Exporting large number of images
Reference Guide
Main menu
Connect to Database
Connecting to databases directly without client libraries installed
Connecting to an Oracle database
Connecting to a DB2 database
Options
General options
Thumbnail options
Hex view
The work area
SQL editor
Results
Other binary data
Image viewer
Hex viewer
Export items wizard
Post-processing Office files
Image options
File naming convention
Datetime format specifiers
Command line interface
Parameters, logs and exit codes
Advanced options
CROP option
Troubleshooting
Expired trial
Invalid licenses
Unidentified images or binary data
DICOM images
Hidden Excel worksheets

CROP option

The CROP option allows you to crop an image prior to saving it to disk. This option needs to be entered in the settings file e.g.


[Export]
ExportImages=1
ExportBinaryData=0
TargetPath=g:\export\images\
NamingConvention=<description>
SQLQuery=SELECT ID, description, binarydata FROM imagesets ORDER BY ID
BatchSize=10
NamingConventionBin=
TargetPathBin=
OverwriteExistingBin=0
MakeUniqueNamesBin=1
ExportPdf=0
ExportDoc=0
ExportXls=0
ExportPpt=0
ExportRar=0
Export7z=0
ExportGz=0
ExportBz2=0
ExportZip=0
ExportMp3=0
ExportWav=0
ExportHTML=0
ExportXML=0
ExportUnknown=0
ExportFormat=0
PDFCompression=0
OriginalFormat=1
PngCompression=0
PngFilterType=0
MakeUniqueNamesImage=1
JpegQuality=0
Crop=(10, 10, 400, 200)

[Database]
Connect=0=(local):sivsample::0


 
 
In the example above, this tells SQL Image Viewer to crop the image starting at the coordinates (10, 10), and ending at (400, 200). You can also provide an offset for the 2nd pair of coordinates, by using the + modifier e.g.

[Export]
...
Crop=(10, 10, +400, +200)

 
 
This means that SQL Image Viewer will crop the image starting at coordinates (10, 10), and ending at (410, 210).

You can also provide the coordinates in terms of percentages using the % modifier e.g.

[Export]
...
Crop=(10%, 10%, 90%, 90%)

 

This means that SQL Image Viewer will crop the image starting at 10% offsets from the left and top, and ending at 90% offsets from the right and bottom. So if an image was 1000 pixels wide and 500 pixels high, the image will be cropped starting at the coordinates (100, 50), and ending at (900, 450).

You can also use offset modifiers together with the percentage modifiers e.g. to get the same results as the above examples using offset specifiers, you would do the following:

[Export]
...
Crop=(10%, 10%, +80%, +80%)

 

Instead of explicit values, you can also use database values from the result set returned by the query used to extract the exported items. To do this, you need to enter the field names that contain the coordinates to crop at e.g.

[Export]
...
Crop=(<crop_x1>, <crop_y1>, <crop_x2>, <crop_y2>)

 

In this example, the images will be cropped starting at the coordinates provided by the fields crop_x1 and crop_y1, and ending at crop_x2 and crop_y2.

about
Database field names must be enclosed in angled brackets e.g. <field01>.

The database fields must contain numeric values.



You can also use offset and percentage modifiers with database values e.g.

[Export]
...
Crop=(<crop_x1>, <crop_y1>, +<crop_x2>, +<crop_y2>)

 
 
[Export]
...
Crop=(<crop_x1>, <crop_y1>, <crop_x2>%, <crop_y2>%)

 

Lastly, you can mix absolute and database values for the cropping coordinates e.g.

[Export]
...
Crop=(10, 10, <crop_x2>%, +<crop_y2>%)