PictPress 1.0



Update (3-jan-2008): I am working on a major rewrite of PictPress that makes it better integrate with the WordPress attachment functionality. This will take some time however.

I finally got around to bumping the version number to 1.0 final, fully supporting WordPress 1.5, just before the release of WordPress 2.0 :-)

PictPress is a WordPress 1.2/1.5 plugin that automatically generates a post with thumbnails and picture posts for all images found in a directory. Thumbnails and pictures are resized on the fly and stored in a cache directory. For an example see my post with pictures of a Treble concert.

Changes since version 0.99

  • Resize does not enlarge images.
  • Options added for sort order.
  • Option added for adding a category to picture posts.
  • Option added for using either picture time or main post time for picture posts.
  • Template function added for printing post modified time (not really PictPress related, but too small for separate plugin).
  • Content filter added for adding thumbnails to other posts.
  • Filter added to add parent title to picture post title.
  • Add page to edit subtitles.
  • Add silent option for omitting debugging comments in posts.
  • Add resize functionality for different aspect ratios, e.g. thumbnails can be square now.
  • Add template functions for generating archives by date and archves by category.
  • Add options page.


Requirements

  • PictPress needs either the ImageMagick convert program or the GD2 library to resize images.
  • PictPress optionally uses exif_read_data or the rdjpgcom program to read comments from the images.; exif_read_data is also optionally used to read EXIF data like picture date etc.
  • You will need some other means to upload images to subdirectories of the WordPress upload directory.

Installation

  1. Unzip pictpress.zip in the plugin directory of your WordPress site. This creates a pictpress directory plus a pictpress.php file.
  2. Go to the Plugin admin page and press the install/upgrade link.
  3. Enable the PictPress plugin on the Plugins admin page.
  4. Make sure that you have configured a valid destination directory for Uploads under Options » Miscellaneous and that the web server has write access to the upload directory.

Usage

  1. First upload one or more JPEG images to a subdirectory of the WordPress upload directory according to the setings for pp_image_dir
    (I use %year%/%monthnum%/%postname% myself).
  2. Then create a new post that will use this directory (in my case by making sure that date and Post Slug are the same as used for the directory).
  3. When pressing Publish, thumbnails for all images will be appended to the post (with a --more-- marker after the first five thumbnails) and for each image a picture post will be generated. The thumbnails have links to the picture posts and the pictures have links to the full resolution images.
  4. Titles for the picture posts are either set to the JPEG comment or to the image filename.
  5. Captions under the thumbnails are set to the corresponding picture post titles and follow updates being made to the titles.
  6. When updating a post, any new images in the image directory are merged with the existing post and the thumbnails are replaced by the new set. This is the way to include new pictures after these have been added to the image directory. Edits to posts between the PictPress comment tags are lost; other edits are kept.
  7. Picture posts are suppressed from the post overview pages and in principle should only appear on pages of their own.

Configuration

There are a number of options that can be confgured via the PictPress options form that can be reached from the WordPress options pages.

  • Location of image directory
  • Location of cache directory for resized images
  • URL used for resized images
  • Size of thumbnails and images on picture pages
    This is either a single number, which specifies the maximumn of width and height, or a number of the form WxH, where W and H specify an exact width and height. In the latter case the image is cropped in the dimension that is too large.
  • Maximum number of thumbnails per page
  • Number of thumbnails before more…
  • Image resize method, ImageMagick or GD2.
  • Sorting order for thumbnails.
  • Strings for use in title, alt attribute, captions.
  • Protect images against referrers from other web sites yes/no.
  • Automatically insert CSS header yes/no
  • Generate a single post for all pictures yes/no; this switches back to the behaviour of the previous version, see the PictPress 0.91 description.

The strings used for title etc. can contain the following variables:

  • %aperture%, EXIF aperture setting
  • %comment%, JPEG comment
  • %date%, EXIF DateTimeOriginal
  • %digitized%, EXIF DateTimeDigitized
  • %edited%, edited date
  • %exif%, table with all info returned by exif_read_data
  • %exposure%, EXIF ExposureTime
  • %focallength%, EXIF FocalLength
  • %height%, height of image in pixels
  • %iso%, EXIF ISOSpeedRatings
  • %make%, camera manufactureer
  • %model%, camera model
  • %modified%, file modified date
  • %size%, file size in bytes
  • %sizekb%, file size in kilobytes
  • %sizemb%, file size in megabytes
  • %title%, title of picture post
  • %width%, width of image in pixels

Template Functions

The following template functions can be used in index.php/sidebar.php:

  • pp_prev_thumb()
    Generate thumbnail for previous picture post if applicable.
  • pp_next_thumb()
    Generate thumbnail for next picture post if applcable.
  • pp_navigation()
    Generate navigation section with thumbnail for previous picture post and thumbnail for next picture post, if applicable.
  • pp_the_parent_title()
    Print the title of the parent post if applicable. Meant to be used before the_title() in the post loop.
  • pp_modified_date ($format='', $before='', $after='', $echo = true)
    Print modified time/date of current post.
  • pp_edit_subtitles_link($link = 'Edit Subtitles', $before = '', $after = '')
    Print link to edit-subtitles page for current post.

Content Tags

PictPress recognizes a number of HTML comment strings and expands them:

  • <!--pp-thumb url--> expands to a thumbnail image pointing to the post with the specified url.

46 Responses to “PictPress 1.0”

  1. Softius says:

    The url is broken. Apparently the right url of the file is http://www.curioso.org/download/pictpress.zip
    Nice work btw

  2. Curioso says:

    Fixed.

  3. Polle says:

    This looks like a great piece of coding!

    However, I seem to have problems getting it started, is there any kind of up to date documentation available that could guide me a bit more detailed through the installation process?

    A few of my questions :

    - Do I need to install ImageMagik or GD2 as well?
    - Are other formats, eg. gif supported?

    Sorry for being a clumpsy noob, thank you in advance!

  4. Matteo says:

    Hi,
    I’m trying to use your plugins, but it doesn’t save the options. It always blank.
    Where pictpress save its options ?

    Bye

  5. Curioso says:

    Polle, I have no additional documentation at the moment.
    You will need either GD2 or ImageMagick installed in order for things to work.
    Currently only JPEG images are supported.

    Matteo, options are saved in the WP database.
    Did you follow the install steps?

  6. Matteo says:

    Hi,
    Sorry, I’ve only activated the plugin not press Install link.
    It’s an excellent plugin !!
    Thanks

  7. Luigi says:

    How is it possible to publish a lot of photos in multiple pages ?
    You did it here: http://www.curioso.org/2004/05/vermeer

    MOre, sometimes the thumbnail are note resized correctly (stretched vertically)

  8. Curioso says:

    Luigi, this post was generated by setting pp_single_page to 1, I am not using this mode anymore myself, because it does not allow comments per picture, all comments are collected for the main post.

    Can you be more specific about when thumbnails are not resized correctly?

  9. Vladimir says:

    Hello, Curioso.
    Very interesting plugin, thanks.
    Your plugin can generate thumbnails for all of uploaded pictures in some directories. It is possible to rewrite plugin, wish automatically place these thumbnails to page instead of placing originals, and open originals in popups by clicking?
    I think about another mechanism, where I can choose, wish picture place to publication by traditional mode, but not want to make additional directories etc.?
    By another words, thumbs generating and popups adding should be for user transparently.
    Thanks.

  10. NoXstar says:

    Maaan, can’t figure out how the program/plugin works! I manage to upload som pictures to wp-content/pictures/test

    “Then create a new post that will use this directory”
    How do you use the directory in my exampel /pictures/%test%/

  11. Keyboard to the Junk says:

    What changes do you think will be needed to support WordPress 2.0 ? Would love this on WP2.

    Thanks a ton!

  12. Curioso says:

    WordPress 2.0 adds attachment functionality, which is similar to what I am doing. I will have to see how to integrate with this.

    But, at the moment WP 2.0 does not work on my system. I am waiting for a more reliable version.

  13. duard - Carlos Aquino says:

    I’m using wp 2.0 :cry: !

  14. ChrisDi says:

    Hi!

    I’m trying to use PictPress for one of my websites but I can’t get it to work (using WP 1.5.2). The situation is:

    Variables setup:
    fileupload_realpath is /var/www/html/www/wordpress/wp-content
    fileupload_url is /wordpress/wp-content
    permalink_structure is %postname%
    pp_image_dir is %postname%
    pp_cache_dir is cache/%size%/%path%

    Files are uploaded to a subdirectory below wp-content called “galerie”. (Webserver has rwx access through the correct group settings).

    I then added an post (Beitrag) called “galerie” with an assosiated category called “Bilder” and wrote some dummy text in the post.

    Then I now access the page “/galerie/” I see the text but no pictures at all. I tried 3 hours to get the plugin deliver the pictures but nothing helped.

    I also created the cache directory by hand but this did not gain anything.

    Now I’m cueless and don’t see any point of error in the setup.

    Can anyone help?

    Regards,

    ChrisDi

  15. ChrisDi says:

    Hi!

    Argh!

    I was blind … I just activated the archive plugin, not the main plugnin. :-)

    And also on the server installed is an old version of ImageMagick which doeesn’t know anything about an “-resize” parameter. I had to change it to “-scale” and now the image gallary is displayed correcly.

    Maybe you can add an option to choos between ImageMagick with support of resize/scale …

    Regards,

    ChrisDi

  16. erik says:

    When I save options I get about 20 copies of this:

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘pp_image_dir'’ LIMIT 1′ at line 1]
    SELECT option_value FROM wp_erik_options WHERE option_name = ‘’pp_image_dir'’ LIMIT 1

    I can save options on the other option pages though. Probably because of the path strings which may mess up the SQL… is this a WP or a PP issue? It seems like my site is hosted on a Windows machine and at least back in the days, PHP and MySQL both behaved a bit different on Windows and Linux, especially in these matters.

  17. Curioso says:

    Erik, I cannot find where this piece of SQL originates from.
    Which versions of WP and PP are you using?

    Anyway, it seems to me that the double quotes should be single quotes, so if you can find this line of SQL you can fix it there.

  18. Jamie says:

    I’m getting Erik’s problem also, I’m guessing it’s because I’m using WP 2 and the fields don’t match up.

    Is there any similar plugin for wp2? I really would like to get this working before I launch this blog section to my site.

    I’m considering using an older version of WP so I can implement this.

  19. passion says:

    The problem can be solved by removing the singlequotes on line 46 in the file “/wp-content/plugins/pictpress/options.php” in the value of the hidden page_options tag.

  20. Curioso says:

    Passion, thanks!
    This seems to have changed from WP1.5 to WP2, I will take a look at it.

  21. C.C. says:

    What exactly do you type into the pre-published post to make the thumbnails. Sorry I’m new to Wordpress and I really don’t understand your instructions above.

  22. Erik says:

    Ditto to C.C.’s question I am dumb help!

  23. Worm says:

    Doesn’t the code work with wp 2.0?

    Curioso; Please contact me at hello@wormie.dk - really wants this to work!

    Thanking you in anticipation

  24. humanbear says:

    hi, i’ve been trying to implement this but have been running into some problems… my settings are:

    image dir: archives/%postname%
    cache dir: cache/%size%/%path%
    resize URL: http://www.humanbear.com/wp-content/plugins/pictpress/resize.php?size=%size%&path=%path%

    however, for my thumbnails and my resized pictures, i get broken links. not sure what i’m doing wrong? please help.

  25. humanbear says:

    do I have to add a line into my .htaccess file? i tried adding the line that you provided for the previous version but then my entire site stopped working…

  26. humanbear says:

    ah, got it. just changed the permissions for the directories where my photos were sitting. thanks for the plugin.

  27. Piero says:

    Hi
    I’m trying to use this beatiful plugin on a WP 2 blog.
    I made several (dozens and dozens) attempts but everything I can obtain is a post with the error:
    * PictPress found no dir /2006/05/galleria *
    I’m SURE the directory exist (and it contains some jpg.
    The image url is %year%/%monthnum%/%postname%
    It is correct (relative to uploads directory).
    Someone has already try to make PictPress working on WP 2?
    Can someone help me?
    Thank in advance!
    Piero

  28. Gerjan says:

    Piero,

    I have exactly the same prob! Any hints, anyone? Please! The plugin is nice!

  29. kat says:

    Hi,

    We are really looking foward to a 2.0 compatible version, and I’m willing to pay for the development.

    Thanks!

  30. kat says:

    we figured out how to make it work with WP2 on our server (iis6), with the following modifications:

    replace pictpress.php line 485 with:
    $href = ‘?p=’ . $post_ID . ‘&page=’ . $image->id;

    search & replace get_settings(’fileupload_realpath’) with real server path to image location, i.e.
    “c:\\inetpub\\wwwroot\\yoursite\\uploads”
    Or even better use a variable to define it once.

    It seems to work this way for us.
    Hope this helps others trying this out.

  31. Mark says:

    Why everytime i update an article i receive one ping comment from my blog on a random picture post ? For example if i update 10 times an article and i have submit 10 pictures for this article, i’ll have 10 commens on every picture

  32. Stephan says:

    I’d love to get a 2.0 (or 2.1) wordpress compatible version. We can pay for the development work, please email me if you’re interested.
    Thanks.

  33. fuBar says:

    Can you please update it to make it compatible with WP 2.1?

    Thanks.

  34. Pau Klein says:

    Your plugin is exactly what I was looking for… but unfortunately I’m using WP 2.0.2
    Keep waiting

    :)

  35. katherine says:

    Any word on how to work with 2.0? I get “” even tho the directory and pics are there…

  36. aveeshkumar says:

    is a WP2+ compatible version coming? yes no soon sometime it’ll help me and the community figure out what to do…thanks

  37. Curioso says:

    Yes, I will upgrade to WP 2.1 or higher at some point.
    The problem now is that I first have to upgrade my server to a new version of Linux with Mysql version 4, which is required by WP 2.1.

    The svn trunk version of PictPress does have some WP 2.1 issues fixed. I would like to hear of any other concrete problems.

  38. BB says:

    Using the svn trunk version of PictPress, I received several errors through the installation process. There were too many to mention here. Just upgrade to WP 2.1.1 and reinstall the plugin and you’ll see what I mean.

  39. IndyCruiseCentral says:

    What’s the trick to making the thumbnails appear? The instructions say to put something into the slug field and leaves the user to wonder what it should be. Putting the ‘date’ into the slug doesn’t work because 2007/04/name-of-the-post gets turned into 200704name-of-the-post.

    There’s no indication of whether this is right or wrong behavior.

  40. Eat My Business » Blog Archive » Choosing a Gallery / Media Presentation plugin for my friend’s WordPress says:

    […] PictPress (http://www.curioso.org/2005/12/09/pictpress-10/) - summary also looked good. also linked to a dead page. perhaps my internet connection is not at full speed. ok now, it was my connenction. Humm. I seem to have been here before. recognise the curioso logo. […]

  41. IndyCruiseCentral says:

    Still getting nowhere fast. I’m baffled that some people say it works great. It doesn’t seem to work at all. Photos upload to folders like /2007/04/ despite the path being specified as /2007/04/name-of-article

    The WP code is nearly impossible to track down how it arrives at this path when the files are uploaded, what with the callback from WP to PictPress, after PictPress has called WP. And I’m quite proficient in PHP.

    And it looked so promising initially…

  42. gedax says:

    is it working with WordPress (Version 2.1.3) ???

  43. BB Group » Blog Archive » 3 megapixel thumbnail limit says:

    […] Also tried 3 different thumbnail plugins that didn’t work. Didn’t try this one: http://www.curioso.org/2005/12/09/pictpress-10/ […]

  44. Green Hunter says:

    is it working with WP (Ver.2.2.2) ?

  45. Curioso says:

    The SVN version is working with WP 2.2, but I am not satisfied with the current level of integration. But this will take time…

  46. Image Gallery Plugin Recommendation >> PiXELWiT says:

    […] PictPress [DEMO] : Link at WordPress.org is wrong, should go to the PictPress main page, nice solution integrates well with WordPress, no slide show, been in “beta” over a year but looks pretty solid. […]

Leave a Reply