- Publicity: Public Only All
photo-album-procs.tcl
TCL library for the photo-album system
- Location:
- packages/photo-album/tcl/photo-album-procs.tcl
- Created:
- December 14, 2000
- Authors:
- Tom Baginski <bags@arsdigita.com>
- Jeff Davis <davis@xorch.net>
- CVS Identification:
$Id: photo-album-procs.tcl,v 1.29 2018/08/14 19:51:10 gustafn Exp $
Procedures in this file
- pa_all_photos_in_album (public)
- pa_all_photos_on_page (public)
- pa_clipboards_multirow (public)
- pa_context_bar_list (public)
- pa_count_pages_in_album (public)
- pa_count_photos_in_album (public)
- pa_expand_archive (public)
- pa_file_info (public)
- pa_flush_photo_in_album_cache (public)
- pa_get_exif_data (public)
- pa_get_folder_description (public)
- pa_get_folder_name (public)
- pa_get_root_folder (public)
- pa_grant_privilege_to_creator (public)
- pa_image_width_height (public)
- pa_insert_image (public)
- pa_is_album_p (public)
- pa_is_folder_p (public)
- pa_is_photo_p (public)
- pa_load_images (public)
- pa_make_file_name (public)
- pa_make_new_image (public)
- pa_page_of_photo_in_album (public)
- pa_pagination_bar (public)
- pa_pagination_context_ids (public)
- pa_pagination_get_total_pages (public, deprecated)
- pa_pagination_paginate_query (public, deprecated)
- pa_rotate (public)
- pa_walk (public)
- photo_album::get_package_id_from_url (public)
- photo_album::list_albums_in_root_folder (public)
- photo_album::photo::get (public)
- photo_album::photo::package_url (public)
Detailed information
pa_all_photos_in_album (public)
pa_all_photos_in_album album_id
returns a list of all the photo_ids in an album sorted in ascending order pull value from cache if already there, caches result and returns result if not
- Parameters:
- album_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_all_photos_on_page (public)
pa_all_photos_on_page album_id page
returns a list of the photo_ids on page page of album_id list is in ascending order
- Parameters:
- album_id (required)
- page (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_clipboards_multirow (public)
pa_clipboards_multirow [ -create_new ] [ -force_default ] user_id \ datasource
creates a multirow datasource with the existing clipboards
- Switches:
- -create_new (optional, boolean)
- add a "Create new folder" entry to list
- -force_default (optional, boolean)
- create the datasource with a default folder even if none exist
- Parameters:
- user_id (required)
- the owner id for the folders
- datasource (required)
- the datasource name to use.
- Author:
- Jeff Davis davis@xarg.net
- Created:
- 2002-10-30
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_context_bar_list (public)
pa_context_bar_list [ -final final ] item_id
Constructs the list to be fed to ad_context_bar appropriate for item_id. If -final is specified, that string will be the last item in the context bar. Otherwise, the name corresponding to item_id will be used. modified from fs_context_bar
- Switches:
- -final (optional)
- Parameters:
- item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_count_pages_in_album (public)
pa_count_pages_in_album album_id
returns the number of pages in album_id
- Parameters:
- album_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_count_photos_in_album (public)
pa_count_photos_in_album album_id
returns count of number of photos in album_id
- Parameters:
- album_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_expand_archive (public)
pa_expand_archive upload_file tmpfile [ dest_dir_base ]
Given an uploaded file in file tmpfile with original name upload_file extract the archive and put in a tmp directory which is the return value of the function
- Parameters:
- upload_file (required)
- tmpfile (required)
- dest_dir_base (optional, defaults to
"extract"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_file_info (public)
pa_file_info file
return the image information from a given file
- Parameters:
- file (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_flush_photo_in_album_cache (public)
pa_flush_photo_in_album_cache album_id
Clears the cacheed value set by pa_all_photos_in_album for a single album Call proc on any page that alters the number or order of photos in an album.
- Parameters:
- album_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_get_exif_data (public)
pa_get_exif_data file
Returns a array get list with the some of the exif data or an empty string if the file is not a jpg file uses jhead Keys: Aperture Cameramake Cameramodel CCDWidth DateTime Exposurebias Exposuretime Filedate Filename Filesize Film Flashused Focallength Focallength35 FocusDist Jpegprocess MeteringMode Resolution
- Parameters:
- file (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_get_folder_description (public)
pa_get_folder_description folder_id
Returns the description of a folder.
- Parameters:
- folder_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_get_folder_name (public)
pa_get_folder_name folder_id
Returns the name of a folder.
- Parameters:
- folder_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_get_root_folder (public)
pa_get_root_folder [ package_id ]
Returns the folder_id of the root folder for an instance of the photo album system. If no root folder exists, as when a new package instance is accessed for the first time, a new root folder is created automatically with appropriate permissions If value has be previously requested, value pulled from cache
- Parameters:
- package_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_grant_privilege_to_creator (public)
pa_grant_privilege_to_creator object_id [ user_id ]
Grants a set of default privileges stored in parameter PrivilegeForCreator on object id to user_id. If user_id is not specified, uses current user.
- Parameters:
- object_id (required)
- user_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_image_width_height (public)
pa_image_width_height filename width_var height_var
Uses ImageMagick program to get the width and height in pixels of filename. Sets height to the variable named in height_var in the calling level. Sets width_var to the variable named in width_var in the calling level. I Use ImageMagick instead of AOLserver function because it can handle more than just gifs and jpegs.
- Parameters:
- filename (required)
- width_var (required)
- height_var (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_insert_image (public)
pa_insert_image name photo_id item_id rev_id user_id peeraddr \ context_id title description mime_type relation is_live path \ height width size
- Parameters:
- name (required)
- photo_id (required)
- item_id (required)
- rev_id (required)
- user_id (required)
- peeraddr (required)
- context_id (required)
- title (required)
- description (required)
- mime_type (required)
- relation (required)
- is_live (required)
- path (required)
- height (required)
- width (required)
- size (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_is_album_p (public)
pa_is_album_p album_id [ package_id ]
returns "t" if album_id is a pa_album that is a child of the root folder for the package, else "f"
- Parameters:
- album_id (required)
- package_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_is_folder_p (public)
pa_is_folder_p folder_id [ package_id ]
returns "t" if folder_id is a folder that is a child of the root folder for the package, else "f"
- Parameters:
- folder_id (required)
- package_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_is_photo_p (public)
pa_is_photo_p photo_id [ package_id ]
returns "t" if photo_id is a pa_photo that is a child of the root folder for the package, else "f"
- Parameters:
- photo_id (required)
- package_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_load_images (public)
pa_load_images [ -remove remove ] [ -client_name client_name ] \ [ -strip_prefix strip_prefix ] [ -description description ] \ [ -story story ] [ -caption caption ] \ [ -feedback_mode feedback_mode ] [ -package_id package_id ] \ image_files album_id user_id
load a list of files to the provided album owned by user_id
- Switches:
- -remove (optional, defaults to
"0"
)- 1 to delete the file after moving to the content repository
- -client_name (optional)
- provide the name of the upload file (for individual uploads)
- -strip_prefix (optional)
- the prefix to remove from the filename (for expanded archives)
- -description (optional)
- -story (optional)
- -caption (optional)
- -feedback_mode (optional, defaults to
"0"
)- to provide much info of the loading process on a bulk upload
- -package_id (optional)
- Optionally specify the package_id owning the album, if this is not called from a page within the photo-album package itself.
- Parameters:
- image_files (required)
- list of files to process
- album_id (required)
- user_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_make_file_name (public)
pa_make_file_name [ -ext ext ] id
constructs a filename for an image based on id and extension.
- Switches:
- -ext (optional)
- Parameters:
- id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_make_new_image (public)
pa_make_new_image base_image new_image geometry
Uses ImageMagick program to create a file named new_image from base_image that fits within a box defined by geometry. If geometry is just a number it will be used for both width and height. ImageMagick will retain the aspect ratio of the base_image when creating the new_image jhead -dt is called to delete any embedded thumbnail since digital camera thumbnails can be quite large and imagemagick does not remove them when converting (so thumbnails can end up being 8k for the thumbnail + 32k for the embedded thumbnail).
- Parameters:
- base_image (required)
- original image filename
- new_image (required)
- new image filename
- geometry (required)
- string as passed to convert
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_page_of_photo_in_album (public)
pa_page_of_photo_in_album photo_id album_id
returns the page number of a photo in an album If photo is not in the album returns -1
- Parameters:
- photo_id (required)
- album_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_pagination_bar (public)
pa_pagination_bar cur_id all_ids link [ what ]
given a current photo_id and an ordered list of all the photo_id in an album creates an html fragment that allows user to navigate to any photo by number next/previous
- Parameters:
- cur_id (required)
- all_ids (required)
- link (required)
- what (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_pagination_context_ids (public)
pa_pagination_context_ids curr ids [ context ]
- Parameters:
- curr (required)
- ids (required)
- context (optional, defaults to
"4"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_pagination_get_total_pages (public, deprecated)
pa_pagination_get_total_pages
Deprecated. Invoking this procedure generates a warning.
returns the total pages in a datasource defined by $sql The sql var must be defined at the calling level. Uplevel used so that any binde vars in query are defined
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_pagination_paginate_query (public, deprecated)
pa_pagination_paginate_query sql page
Deprecated. Invoking this procedure generates a warning.
takes a query and returns a query that accounts for pagination
- Parameters:
- sql (required)
- page (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_rotate (public)
pa_rotate id rotation
Rotate a pic
- Parameters:
- id (required)
- the photo_id to rotate
- rotation (required)
- the number of degrees to rotate
- Author:
- Jeff Davis davis@xarg.net
- Created:
- 2002-10-30
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
pa_walk (public)
pa_walk dir
Walk starting at a given directory and return a list of all the plain files found
- Parameters:
- dir (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
photo_album::get_package_id_from_url (public)
photo_album::get_package_id_from_url [ -url url ]
Returns package_id of instance from URL
- Switches:
- -url (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
photo_album::list_albums_in_root_folder (public)
photo_album::list_albums_in_root_folder \ [ -root_folder_id root_folder_id ]
Returns a list of albums for a specific instance of photo-album
- Switches:
- -root_folder_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
photo_album::photo::get (public)
photo_album::photo::get -photo_id photo_id -array array \ [ -user_id user_id ]
return an array with the photo data. elements are: photo_delete_p admin_p write_p album_write_p album_id caption description photo_id story title image_types (list of available related images "base" "viewer" "thumb") For each image type there is (eg viewer here): viewer_content viewer_content_length viewer_height viewer_image_id viewer_latest_revision viewer_live_revision viewer_name viewer_relation_tag viewer_width
- Switches:
- -photo_id (required)
- -array (required)
- -user_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
photo_album::photo::package_url (public)
photo_album::photo::package_url [ -photo_id photo_id ]
given a photo_id (can be an item or revision_id) return the package_url for the corresponding photo. does not include the site part just the path.
- Switches:
- -photo_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.