pa_file_info (public)

 pa_file_info file

Defined in packages/photo-album/tcl/photo-album-procs.tcl

return the image information from a given file

Parameters:
file (required)

Partial Call Graph (max 5 caller/called nodes):
%3 pa_load_images pa_load_images (public) pa_file_info pa_file_info pa_load_images->pa_file_info packages/photo-album/www/photo-add-2.tcl packages/photo-album/ www/photo-add-2.tcl packages/photo-album/www/photo-add-2.tcl->pa_file_info parameter::get parameter::get (public) pa_file_info->parameter::get

Testcases:
No testcase defined.
Source code:
 
    set info [list]
    if { [catch {set size [file size $file]} errMsg] } { 
        return -code error $errMsg
    } 
    if { [ catch {set out [exec [parameter::get -parameter ImageMagickPath]/identify -format "%w %h %m %k %q %#" $file]} errMsg]} { 
        return -code error $errMsg
    }            
    
    foreach {width height type colors quantum sha256} [split $out { }] {}
    switch $type { 
        JPG - JPEG {
            set mime image/jpeg
        } 
        GIF - GIF87 { 
            set mime image/gif
        } 
        PNG { 
            set mime image/png
        } 
        TIF - TIFF { 
            set mime image/tiff
        }
        default { 
            set mime {} 
        }
    }
    
    return [list $size $width $height $type $mime $colors $quantum [string trim $sha256]]
Generic XQL file:
packages/photo-album/tcl/photo-album-procs.xql

PostgreSQL XQL file:
packages/photo-album/tcl/photo-album-procs-postgresql.xql

Oracle XQL file:
packages/photo-album/tcl/photo-album-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: