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.
- PictPress needs either the ImageMagick
convertprogram or the GD2 library to resize images. - PictPress optionally uses
exif_read_dataor therdjpgcomprogram to read comments from the images.;exif_read_datais 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
- Unzip
pictpress.zipin the plugin directory of your WordPress site. This creates apictpressdirectory plus apictpress.phpfile. - Go to the Plugin admin page and press the install/upgrade link.
- Enable the PictPress plugin on the Plugins admin page.
- 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
- 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). - 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).
- 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. - Titles for the picture posts are either set to the JPEG comment or to the image filename.
- Captions under the thumbnails are set to the corresponding picture post titles and follow updates being made to the titles.
- 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.
- 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 beforethe_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 specifiedurl.
December 13th, 2005 at 10:12
The url is broken. Apparently the right url of the file is http://www.curioso.org/download/pictpress.zip
Nice work btw
December 13th, 2005 at 10:12
Fixed.
December 16th, 2005 at 12:12
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!
December 18th, 2005 at 17:12
Hi,
I’m trying to use your plugins, but it doesn’t save the options. It always blank.
Where pictpress save its options ?
Bye
December 19th, 2005 at 14:12
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?
December 19th, 2005 at 15:12
Hi,
Sorry, I’ve only activated the plugin not press Install link.
It’s an excellent plugin !!
Thanks
December 21st, 2005 at 21:12
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)
December 22nd, 2005 at 08:12
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?
December 24th, 2005 at 01:12
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.
January 3rd, 2006 at 21:01
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%/
January 14th, 2006 at 18:01
What changes do you think will be needed to support WordPress 2.0 ? Would love this on WP2.
Thanks a ton!
January 16th, 2006 at 08:01
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.
January 17th, 2006 at 17:01
I’m using wp 2.0
!
February 13th, 2006 at 23:02
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
February 14th, 2006 at 07:02
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
February 17th, 2006 at 22:02
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.
February 20th, 2006 at 10:02
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.
February 22nd, 2006 at 02:02
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.
March 2nd, 2006 at 15:03
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.
March 2nd, 2006 at 16:03
Passion, thanks!
This seems to have changed from WP1.5 to WP2, I will take a look at it.
March 7th, 2006 at 03:03
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.
March 8th, 2006 at 07:03
Ditto to C.C.’s question I am dumb help!
March 14th, 2006 at 16:03
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
April 23rd, 2006 at 19:04
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.
April 23rd, 2006 at 19:04
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…
April 23rd, 2006 at 19:04
ah, got it. just changed the permissions for the directories where my photos were sitting. thanks for the plugin.
May 22nd, 2006 at 21:05
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
August 11th, 2006 at 21:08
Piero,
I have exactly the same prob! Any hints, anyone? Please! The plugin is nice!
October 16th, 2006 at 21:10
Hi,
We are really looking foward to a 2.0 compatible version, and I’m willing to pay for the development.
Thanks!
October 16th, 2006 at 23:10
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.
October 21st, 2006 at 13:10
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
January 23rd, 2007 at 22:01
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.
February 7th, 2007 at 09:02
Can you please update it to make it compatible with WP 2.1?
Thanks.
March 11th, 2007 at 21:03
Your plugin is exactly what I was looking for… but unfortunately I’m using WP 2.0.2
Keep waiting
:)
March 21st, 2007 at 20:03
Any word on how to work with 2.0? I get “” even tho the directory and pics are there…
March 23rd, 2007 at 14:03
is a WP2+ compatible version coming? yes no soon sometime it’ll help me and the community figure out what to do…thanks
March 24th, 2007 at 17:03
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.
March 31st, 2007 at 08:03
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.
April 12th, 2007 at 14:04
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.
April 13th, 2007 at 02:04
[…] 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. […]
April 13th, 2007 at 03:04
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…
April 29th, 2007 at 13:04
is it working with WordPress (Version 2.1.3) ???
April 30th, 2007 at 01:04
[…] Also tried 3 different thumbnail plugins that didn’t work. Didn’t try this one: http://www.curioso.org/2005/12/09/pictpress-10/ […]
August 16th, 2007 at 08:08
is it working with WP (Ver.2.2.2) ?
August 25th, 2007 at 14:08
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…
November 24th, 2007 at 22:11
[…] 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. […]
December 19th, 2008 at 18:12
I read about your plugin and found your page. Tried to install PictPress and when I go to activate the plugin I get “Plugin could not be activated because it triggered a fatal error” and then I get:
Warning: require_once(/home/joshrodg/public_html/ourpictureshare.com/wp-content/plugins/pictpress/wp15.php) [function.require-once]: failed to open stream: No such file or directory in /home/joshrodg/public_html/ourpictureshare.com/wp-content/plugins/pictpress/pictpress.php on line 15
I am using 2.7 — Any ideas?
December 26th, 2008 at 17:12
The file wp15.php should be present in the zip file. Is it not?