image::resize (public)
image::resize [ -item_id item_id ] [ -revision_id revision_id ] \ [ -size_name size_name ]
Defined in packages/acs-content-repository/tcl/image-procs.tcl
Create a thumbnail of an image in the content repository
- Switches:
- -item_id (optional)
- item_id of image
- -revision_id (optional)
- -size_name (optional, defaults to
"thumbnail"
)- Returns:
- image item_id of the thumbnail
- Author:
- Dave Bauer <dave@solutiongrove.com>
- Created:
- 2006-08-27
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if {$revision_id eq ""} { set revision_id [content::item::get_best_revision -item_id $item_id] } set original_filename [content::revision::get_cr_file_path -revision_id $revision_id] set tmp_filename [ad_tmpnam "[ad_tmpdir]/XXXXXX"] array set sizes [image::get_convert_to_sizes] if {[catch {exec [image::convert_binary] -resize $sizes($size_name) $original_filename $tmp_filename} errmsg]} { # maybe imagemagick isn't installed? file delete -- $tmp_filename return "" } if {[set resize_item_id [image::get_size_item_id -item_id $item_id -size_name $size_name]] eq ""} { set resize_item_id [image::new -item_id $resize_item_id -name "${item_id}_${size_name}" -parent_id $item_id -relation_tag "image-${size_name}" -tmp_filename $tmp_filename] } else { content::revision::new -item_id $resize_item_id -tmp_filename $tmp_filename } file delete -- $tmp_filename return $resize_item_idXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-content-repository/tcl/image-procs.xql