> pictools > doc > servepicture
> pictools > doc > servepicture
Pictools: Driver Pages
V3.3 (291)
Invoked to display a picture designated in a captions file; instantiates a frame.php to display the picture
usage, in URL: physpics.com/library/servepicture.php ?cap=directory/capfile.cap &image=imagename.extension
Sample picture page

The above usage information is misleading. In practice, servepicture is invoked via /.htaccess or /admin/urlHandler.php. See the description in ShowingPictures.

The algorithm in servepicture.php calls pkscripts:parsecaps to see if the designated .cap file has the correct [ ] picture line. If that line is absent, the algorithm goes on searching for it in parent directories. If it's not there either, the request fails via forPhyspics:pagefail.

When returning success for a picture [ ] line, parsecaps also returns an associative array as documented in pkscripts. The members of the array, under keys rawcaption, pixname, and so on, contain all the information needed to display the picture. This information is inserted in the in-memory properties environment by calling pkscripts:setframeparms. Then property "frame.wholepage" is fetched and the page it names is invoked. The default wholepage is frame.php, which takes values from the in-memory properties and displays the picture.

Copyright © 2016 ZweiBieren, All rights reserved. Jul 4, 2016 21:35 GMT Page maintained by ZweiBieren