You are not logged in Log in Join
You are here: Home » Members » Drew » Photo » Photo Info » View Document

Log in
Name

Password

 

Photo Info

Photo and ZPhotoAlbum Product

Beta Release Disclaimer

This release of Photo and ZPhotoAlbum is a beta version and is intended for developers only. The DTML methods, web management screens and data storage properties may all change before a stable release. An upgrade path may not be provided.

ZPhotoAlbum Product Description

The ZPhotoAlbum product allows the content manager to organize their photo collection. ZPhotoAlbum may be used stand alone or integrated with a news system. ZPhotoAlbum catalogs each ZAlbumPage and ZPhoto that it contains automatically. Each ZPhoto has its own title, caption, copyright text, meta keywords, description, and other attributes which are fully searchable.

ZPhotoAlbum comes with three default presentation interfaces. Simple uses basic HTML, fully and quickly renderable in any browser. Explore uses a frames-based explorer-like interface. Fancy will make Martha Stewart jealous, but the HTML purist puke.

ZPhotoAlbum is ZClass based and should be fully and easily extendable by the content manager.

Photo and ZPhotoAlbum Online Example

For a quick overview of the features of ZPhotoAlbum and Photo visit the following example, production site.

http://www.jpdesserts.com

Warning - Do NOT visit this site while hungry. The author is not responsible for teeth marks on your computer monitor.

ZPhotoAlbum Quickstart

  1. ZPhotoAlbums are designed to be very easy for content managers.
  2. Select ZPhotoAlbum from the Add Product dropdown in the Zope management screen.
  3. Before uploading any images, set the default displays in your ZPhotoAlbum.
  4. Recreate the default DTML in the Default DTML tab.
  5. From inside the ZPhotoAlbum, add a ZAlbumPage.
  6. From inside the ZAlbumPage, add additional ZAlbumPages or ZPhotos.
  7. View your ZPhotoAlbum using through one of the predefined interfaces, some examples:
            http://www.yoursite.com/photoalbum/simple/photoalbum/mypage
               # Displays the ZAlbumpage named mypage using the simple view
            http://www.yoursite.com/photoalbum/explore/photoalbum/
               # Displays the ZPhotoAlbum named photoalbum using the explore view
            http://www.yoursite.com/photoalbum/fancy/mypage/myphoto/photo_index_html
               # Displays the ZPhoto named myphoto using the fancy view
    
        Known Bugs
    
          1. When CUTing and pasting between ZAlbumPages, the paste fails with a
             aq_aquire value error. I have no clue.
          2. The predefined search functions only search the ZPhoto descriptions.
             Usually, the ZCatalog method searchResults returns a LazyCat object.
             I don't have a clue about joining (unioning actually) these LazyCat
             objects. Combining searchs usually means getting back ZCatalog records
             that point to the same object.
          3. The *keywords* property does not display properly, (or edit properly?)
             in the predefined manage_properties tab. I wonder if the *lines* 
             property type is only available to ZClass property sheets and not
             python classes which are later sub-classed. Oh well, I should be able
             to fix this by defining a custom manage_properties method. Meanwhile,
             just get your keywords correct the first time.
          4. The default colors are ugly.
    

Photo Product

The Photo product allows the user to view an image at their preferred display size. The preferred display size is saved in a cookie. The Photo product also automatically produces a thumbnail.

The Photo product works by resizing the image after upload using PIL. The default display sizes correspond to all popular display sizes, including webtv. Displays can be added, removed and resized using the Web management interface and through DTML methods.

Photo is meant to take the teadium out of interfacing with PIL or some other batch image processing program for images.

Photo Usage

Here are some html usage examples:

        http://www.server.com/image?display=[webtv, xsmall, small ... xlarge]
            # Display the photo at this size
        http://www.server.com/image
            # Display the image original size

Here are some DTML usage examples:

        <dtml-var image> 
            # Insert html to render the preview display, if it exists
            # Otherwise, the original image is displayed
        <dtml-var "image.tag(REQUEST, pdcookie='1')">   
            # Insert html to render the photo using the user's pdcookie
            # Insert additional html to display the available displays
            # and allow the user to select a new display size 
            # for thier pdcookie
        <dtml-var "image.tag(REQUEST)">   
            # Insert html to render the photo using the user's pdcookie
        <dtml-var "image(display='thumbnail')">   
            # Insert html to render the webtv display
            # Specifing a display always overrides a user's pdcookie
        <dtml-var "image(height=220,width=190)"> 
            # Insert html to dynamically render an image
            # Note that this involves significant resources
            # to render the image each time it is displayed
        <dtml-var "image(REQUEST, pdcookie='true', border=0)"> 
            # This is how I typically call a photo object

Converting Images to Photos

Stephen Pitts uploaded many images using FTP and then converted them to Photos. He suggested using dtml to convert Images to Photos. His example:

       <dtml-in "objectItems('Image')">
         <dtml-with sequence-item>
           <dtml-call "PARENTS[0].manage_delObjects([id(),], REQUEST)">
           <dtml-call
            "PARENTS[0].manage_addProduct['Photo'].manage_addPhoto(
                   PARENTS[0], id(), data, title, REQUEST)">
         </dtml-with>
       </dtml-in>
       Image to Photo Conversion Complete!

       Please note that PIL must generate the default displays for each Image
       upon upload or conversion. That means that this can be a slow process.

  Notes on Digital Imagery

      I am not a photographer, I am just a developer, so I
      recommend that you follow the instructions at 

      http://www.photo.net/wrt/thebook/images.html

      to create beautiful online photos. Moving forward, I am
      going to try and incorporate more of these suggestions
      directly into Photo, so that you don't have to think
      about it. Your online Photos just look good.

  Note on Displays

    When uploading images, the image size should optimally be larger than
    the largest desired display size. The predefined display sizes
    correspond to the minimum amount of avaliable 
    space for a maximized web browser on the most popular standard displays.

    * thumbnail 128x128

    * preview   370x263

    * webtv     544x378

    * xsmall    623x278

    * small     783x398

    * medium    1007x566

    * large     1135x668

    * xlarge    1263x822

    If you need to change the default displays, and you don't want to write
    a DTML method to initialize Photo with the correct displays, then please
    consider using the ZPhotoAlbum product, which can pass a custom default
    display map to each ZPhoto upon creation.

Installation

Installation instructions are provided in INSTALL.txt. My instructions are the worst around, try the instructions in the POLL package instead. I have heard that the instructions with TTImage are also good. I should clean these up before a stable release. The truth is, I still have trouble getting Zope and PIL to play nicely together.

If PIL is not installed and available to python, the Photo package will be broken in Control Panel. PIL must be packagized, installed, and available in python's path. If you are using a binary distribution of Zope, please be sure that PIL is available to the python included with the Zope binaries. For more information on installing PIL, please see the install_PIL directory included with this distribution.

To Do

  1. Also see the source code. 2. PTK Integration! 3. Consider converting to Imagemagick! 4. Improve the fancy view.

License

Please read the license information in LICENSE.txt

Changes

Please read the change information in CHANGES.txt

Feedback

Your feedback is desperately needed to make Photo a successfull Zope product. Thank you all for the many usefull bug reports and suggestions so far. If you have previously requested something and you don't see it in this release, than I need to hear about it again!

Special Thanks to the following Bug Report and Suggestion Contributors!

  • Stephen Pitts
  • Douglas Hardison
  • David Olivari
  • Jochen Haeberle
  • "Gregor"
  • Dale Lance
  • Nicolas Piper
  • Joe Wronkowski
  • Chris Petrilli (last but not least)

Enjoy! Drew