PictPress 0.91
Update: The newest version is PictPress 1.0.
Important: This version does not properly check the size argument to the resize.php script and is vulnerable to website attacks. Please update to later versions.
PictPress is a wordpress 1.2 plugin that automatically appends thumbnails and picture pages to a post for all images found in a directory associated with the post. Thumbnails and pictures are resized on the fly and stored in a cache directory. For an example see my post with Vermeer paintings.
Requirements
- PictPress needs the ImageMagick
convertprogram to resize images. - PictPress uses the
rdjpgcomprogram to read comments from the images. - The function
exif_read_datais optionally used to read EXIF data like picture date etc.
Installation
- Unzip
pictpress.zipin the root directory of your site. This creates apictpressdirectory next yourwordpressdirectory. - Move, copy or link the file
pictpress/pictpress.phpto the WordPress plugin directory, e.g. on a Unix systemln pictpress/pictpress.php wordpress/wp-content/plugins - Enable the PictPress plugin on the Plugins admin page.
- Insert a line
RewriteRule ^cache/([0-9]+)/(.*) /pictpress/resize.php?size=$1&path=$2 [QSA]
in your.htaccessfile.
Usage
- First upload one or more JPEG images to the directory you want to use
(I use/images/%year%/%monthnum%/%postname%myself). - Then create a new post that will use this directory (in my case by setting date and Post Slug 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 page will be appended to the post. The thumbnails have links to the picture pages and the pictures have links to the full resolution image. - Subtitles are added to the picture pages using the h4-tag, where the subtitle is either set to the JPEG comment or to the image filename.
- Captions under the thumbnails are set to the subtitles and follow updates being made to the subtitles.
- 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. Already existing picture pages are not replaced and any edits you make there are retained when updating. Edits to thumbnails are lost
Configuration
There are a number of parameters that you can adjust at the top of the pictpress.php file.
- Location of image directory
- Size of thumbnails and images on picture pages
- Maximum number of thumbnails per page
- Number of thumbnails before more…
- Automatically insert CSS header yes/no
May 28th, 2004 at 22:05
I was just looking at pictpress, and your sample page. One thing I noticed is that the pictures disappear under the sidebar. While I think this is more a problem with the stylesheet and/or page template, you might want to look into it.
May 29th, 2004 at 01:05
RTFM! I did it.But sorry, it’s too short and I need more. Maybe because you already have some huge blog and programming experience (and it’s the case with all the WordPress gurus) you are not explanning some basics things or vocabulary.
Your plugin seems really ammazing but for me right now it is useless. Like many poeple on earth, I am a foreigner and my english is not so good so please try to be more “low level” for newbies like me. (And excuse my french !
“Insert a line
RewriteRule ^cache/([0-9]+)/(.*) /pictpress/resize.php?size=$1&path=$2 [QSA]
in your .htaccess file.”
Where is this file? I don’t find it. Maybe it’s because of the new WordPress version.
“(I use /images/%year%/%monthnum%/%postname% myself)”
What does that mind? Why is there some %? Do you mind “have a folder named “images” with a folder names “%year%” in it and so on…
“Then create a new post that will use this directory (in my case by setting date and Post Slug the same as used for the directory).”
- I do not understand this. What does mind “Post Slug”?
Some screenshots will be welcome. And a cup of tea with some sugar too. Thanks.
Thank you for your support.
May 29th, 2004 at 16:05
GerenM, I will take a look at the style sheets some time later. Problem is that the layout with images depends very much on the window size used in the browser….
Logicalnot, you are right, I am assuming a lot of kowledge about the basic WordPress operation….
The %year% etc are used if you have permalinks enabled (Options->Permalink in the admin screens). There you will also see that you have to create a .htaccess file. The /cache rewrite rule must be in the top level .htaccess, if you have one depends on where you have your weblog located, I have mine at the top level…
In a next version I will make these rewrite rules optional, so you won’t have to bother with that.
The Post Slug is the name you can attach to a post in the advanced editing screen and it is available as %postname% in the permalink.
May 30th, 2004 at 06:05
I have been trying to get Pictpress to work on my WP1.2 installation (tried .90 and .91) and have run out of options.
My weblog is in /var/www/html/brain.bur.st, Pictpress is in /var/www/html/brain.bur.st/pictpress. The host is a virtual host, so the server root is /var/www/html/brain.bur.st. The rewrite rule is in place in /var/www/html/brain.bur.st/.htaccess along with the others for permalinks. Permalinks are enabled as /%year%/%monthnum%/%postname%/.
After downloading 0.91, I set the image directory to /images/%year%/%monthnum%/%postname%/ and moved the jpg’s to the appropriate directory /var/www/html/brain.bur.st/images/2004/05/test-pics.
The plugin is symlinked from /var/www/html/brain.bur.st/wp-content/pictpress.php to /var/www/html/brain.bur.st/pictpress/pictpress.php.
Convert, rdjpgcom, and the php exif plugin are installed.
I know that at least part of it is working, as browsing to www.brain.bur.st/cache/100/images/2004/05/test-pics/chugaluga.jpg, results in the cache directory and thumbnail being created and displayed, however when I create a post named “Test Pics”, which has the Slug “test-pics” and publish, neither a cache directory with thumbnails nor code to display them are created…
Please help, I’m tearing my (not much) hair out!
Cheers…
May 31st, 2004 at 20:05
I think that the wrapping issue when using IE on a PC has to do with the way that IE deals with “floats” in CSS. In the meantime, a more pressing issue. For some reason, images do not appear when using IE on a Mac (running MacOS 9.2 and IE 5.2). I see a little box the correct width, but with no height (only the height of the frame), and no image in the little horizonal slit. Not sure what’s up with that.
June 1st, 2004 at 10:06
Dementis, did you enable the plugin?
Otherwise you might add some echo statements to the plugin to see what it is doing.
You need to add something like echo “PictPress loaded\n”; to the end of the plugin to prevent losing the other output.
June 2nd, 2004 at 01:06
Yes, the plugin is enabled. Adding `echo “Pictpress loaded\n”; to the end of the plugin does result in “Pictpress loaded” appearing at the top of the create new post page above the Wordpress logo.
Errors regarding “Headers already sent” resulted from publishing the post.
If I move the echo statement to within pp_css_head, after the
June 2nd, 2004 at 09:06
Ignore these ‘Headers already sent’ messages, just keep the echo “Pictpress loaded\n” at the end of the plugin and add echo “$dirname\n”; after the first few lines of pp_add_picture_pages where it sets $dirname to see if the directory anme used there is correct.
June 2nd, 2004 at 10:06
Thankyou, it works now!
$dirname showed that the path to the images included ../ (/var/www/html/brain.bur.st/../images/2004/06/test-pics). It took me a couple minutes of checking pp_get_image_path to actually notice that the “..” was prepended to the path in this line in pp_add_picture_pages:
$dirname = ABSPATH . “..” . $path;
I changed that line to $dirname = ABSPATH . $path; and the problem is now resolved.
Thanks again for your help.
Cheers.
June 2nd, 2004 at 10:06
OK, I am assuming that the wordpress directory is next to the pictpress directory…
I will probably add an extra configuration variable for that in the future
June 3rd, 2004 at 20:06
GerenM, the problem with IE on Mac is solved by removing the position:relative line from pictpress.css.
June 4th, 2004 at 05:06
I posted another message in the other post for this plugin (I assume, the older version). I’m trying to get this to work and even the good people from my web host can’t figure out what’s wrong.
Anyway, I created a folder for pictpress in my root folder (WP is in the root folder)
mysite.com/pictpress/
in this folder, i uploaded all the files except pictpress.php . is this correct? or, should i upload the files in my root folder instead?
i put that file in wp-content/plugins/pictpress.php
i ammended the configuration in that file as follows:
$pp_imagedir = “/archives/%year%/%monthnum%/%postname%”;
(i used archives instead of images).
yes, all i am told i have all the system requirements. and yes, i have permalinks and the plugin enabled.
why am i still seeing blank here - http://www.shaicoggins.com/archives/2004/06/abstracts-gallery-1/
thanks for your help!
June 4th, 2004 at 08:06
Shai, you also seem to have all wordpress files in your site’s root directory. I am assuming it is in a wordpress or weblog or whatever directory.
To correct this, you have to change these three lines:
pictpress.php: include_once (ABSPATH . “../pictpress/class.image.php”);
pictpress.php: include_once (ABSPATH . “../pictpress/class.imagedir.php”);
pictpress.php: $dirname = ABSPATH . “..” . $path;
to:
pictpress.php: include_once (ABSPATH . “pictpress/class.image.php”);
pictpress.php: include_once (ABSPATH . “pictpress/class.imagedir.php”);
pictpress.php: $dirname = ABSPATH . $path;
June 4th, 2004 at 17:06
[…] 8230; Planar om tillegg og hacks: wap-plugin her, unzip og fyr! versjon2? amazon wysiwyg bilde-plug With this plugin you can give your users an interface to convert anything on your blog […]
June 5th, 2004 at 08:06
Thanks, Curioso. I think that was helpful. But now, I encounter this error whenever I post something :
Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/www/www/wp-content/plugins/pictpress.php:265) in /home/mysite/www/www/wp-admin/post.php on line 340
June 5th, 2004 at 08:06
oh wait! it works now. wow this is terrific. thanks! looks like that the job. YAY!
June 5th, 2004 at 09:06
Ooops. Sorry about this. Now I have a new question. How do you get the captions to work?
June 5th, 2004 at 12:06
Shai, if you edit the post again after publishing and fill in the h4 tags, the text will also be used automatically as captions under the thumbnails.
June 6th, 2004 at 09:06
Doh! I was editing at the wrong place… :p Thanks for all your help! Even if there are a few bugs that need to be ironed out still (like that silly error message every time I post or edit something and the disappearing thumbs), I think PictPress is one of the best WP plugins. Terrific job!
June 6th, 2004 at 10:06
Hi! Just installed PictPress, and it’s quite good. However, as suggestions: 1) Documentation might want to note that if the web server cannot write to the WordPress directory, you’ll need to manually create the “cache” directory and set permissions so that the web server can write to it; 2) A separate config file would be better than changing variables in the plugin .php file; 3) The cache directory name might want to be configurable; 4) The location of the convert program, etc, should be configurable; 5) You might want to use MIME to ensure that the images you are passing to convert are actually images (in case non-image files are placed in the gallery), and also so that PictPress can support more than just JPEG images. Cheers!
June 10th, 2004 at 03:06
hello, I just installed pictpress, it works great except for the fact that no thumbnail was created at all T_T, I’m not sure what I did wrong, and my host said that they have imageMagick installed, if you can help it would be great
Thanks ^^
shari
June 10th, 2004 at 11:06
Shari, I cannot see from here what is going wrong.
Your thumbnail URLs are of the form http://survivebadblood.com/cache/100/blog/images/2004/elijah/elijahgap4.jpg
Did you add the RewriteRule for /cache at the top level as necessary for your URLs?
What directory structure are you using for storing PictPress and WordPress files?
June 10th, 2004 at 13:06
oops… O_o
of course it doesn’t work ^^;;;, didn’t pay attention to rewriterule.. ^^;;;
my blog (and all the wp files) is in http://survivebadblood.com/blog and my pictpress folder is in http://survivebadblood.com/pictpress , and my rewrite is under /blog, my images folder is also under /blog
tho, I tried to put .htaccess in root folder too, it still doesn’t work T_T
June 10th, 2004 at 14:06
The .htaccess in your root folder should look like:
RewriteEngine On
RewriteBase /
RewriteRule ^cache/([0-9]+)/(.*) /pictpress/resize.php?size=$1&path=$2 [QSA]
June 10th, 2004 at 18:06
ow, I added that, it still doesn’t work tho..
*bang head*
June 11th, 2004 at 11:06
Shari, you now get this error message for the thumbnails:
Warning: readfile(/home2/jdarkroo/public_html/survivebadblood/pictpress/../cache/100/blog/images/2004/elijah/elijahgap4.jpg): failed to open stream: No such file or directory in /home2/jdarkroo/public_html/survivebadblood/pictpress/resize.php on line 22
You do have a cache directory and two subdirectories that I can see.
What else is there (I cannot see deeper than the 100 and 370 directories)?
Are the premissions right to create the JPEG files there?
June 11th, 2004 at 15:06
meep.
all the folders are there down to the post name, but no jpgs were created, all the created folders permission are 755, and when I tried to change permission via ftp, it said something about bad file descriptor. and I cannot chmod it T_T
June 11th, 2004 at 20:06
Be sure to update the Wiki Link. I’d like to see a version of this Plugin, which allows for comments to be posted about each of the photos in the set or album. That’d be interesting. Almost like grouping posts.
June 11th, 2004 at 20:06
Also, a way to download all the images at the end of the post (optional) would be nice as well.
June 15th, 2004 at 05:06
Hey, I got the script working without too much trouble…only to find out that I don’t have imageMagick on my server.
Any plans for using GD in a future version? This is the best photolog script I’ve seen thus far for Wordpress…
June 15th, 2004 at 13:06
GD will be added in the future.
June 15th, 2004 at 23:06
Ok, I think I got ImageMagick installed on my server, but it’s still not working. Isn’t there some kind of php frontend that has to be installed before you can communicate to the program?
June 17th, 2004 at 08:06
[…] ake WordPress become a photolog. On top of my head, the list are: Pictorialis Exhibit PictPress PhotoStack Photos After giving each one a short spin, I must say, I don’t real […]
June 24th, 2004 at 05:06
Sorry…I think I’m still new to Wordpress. I have put pictpress.php in /wp-content/plugins folder. Activiated the plugin. Put all other files in /pictress in parallel to my wordpress folder. Modified the .htaccess code. Why there is still nothing happened? Did i miss something???
June 24th, 2004 at 14:06
Hard top say without more information.
You have specified the correct image directory?
Try what I suggest in comment 6 and 8.
June 24th, 2004 at 15:06
Thanks, Curioso. A very nice guy from my hosting company helped me to configure it. And the pictpress is working now. You may come to have a look of my pics
BTW, I honestly find that the documentation of pictpress is really quite vague and abstract to non-professionals. Do you mind I writing a more user-friendly documentation to you? Though my knowledge to php is limited, I think I can write some guidelines helping people to install it.
June 24th, 2004 at 16:06
Feel free to write something, I tend to skip over all kinds of non-trivial things…
June 24th, 2004 at 18:06
hi curioso, is it possible to make the page of the pictures starts from “0″ rather than “1″? Since the first page actually is an index page, and the first picture starts with page 2, it will be logically more sounding if the index page should be called “menu” or “0″.
June 25th, 2004 at 13:06
Jason, the list of page numbers is a standard WordPress feature that is not easy to change. It is generated by the call to wp_link_pages in your index.php file.
What you can do is change this in your index.php file to just point to the next page by calling it as wp_link_pages(’next_or_number=next’), and this will apply then to all your pages, not just the pages with PictPress generated thumbnails.
June 26th, 2004 at 06:06
I loaded the code per your instruction into my root, making all the changes described above. Works great except one issue. The thumbnails are correctly created in the correct place, but will not display thumbnail pic in the message body. I get the thumbnail placeholder only, and the properties path out correctly to the thumbnail. If I click on the placeholder it will show the full image, but the thumbnails refuse to be visible. Ideas? Permissions are 755 all the way down the cache path. htaccess is correct. I must be missing something obvious… Check it out here: http://xyth.com/index.php?cat=3 Thanks
June 26th, 2004 at 06:06
Never mind, solved it. I had hotlink protection set on in Cpanel. Works fine with it turned off. Now I just need to figure out how to enable hotlink protection without losing the thumbnail.
June 26th, 2004 at 14:06
hmm. I have installed all the relevant files and changed .htaccess in my web root [i have wp installed in the root] and I keep getting a server error 500, checking the logs I find “RewriteRule not allowed here”.
I have also created the cache directory and made sure the webserver can write to it.
I have the .htaccess file, in the root, the same as defined in post 24 above.
Any ideas??
June 26th, 2004 at 19:06
Any idea where I can find a Linux build of rdjpgcom? My host says its not installed, but I can load it in my root. Ideas? It would be a nice future enhancement to use the $identify feature of ImageMagik as an option to replace rdjpgcom. Thanks.
June 29th, 2004 at 22:06
OK… after reading through all the comments, I’m even more stumped than before: What I just unzipped has a pictpress.php FOLDER but now pictpress.php FILE whatsoever! Any idea what’s going on? I’ve never seen such a thing before.
July 14th, 2004 at 10:07
Been trying a while to get this to work. I am certain it is something stupid I am missing, but I cannot figure out what.
The cache is not used, images do not show up as thumbs or otherwise. I attempted what you mentioned in 6 and 8, echoing PictPress loaded did nothing but cause errors when attempting to login, but it did display the message. Attempting to display the directory acomplshed nothing.
I have wordpress located in my sites root directory, so folowed what you instructed in step 13, also to no avail.
Any help would be much appreciated. Thanks.
August 13th, 2004 at 01:08
[…] page on the wiki in a while and found a few plugins I’d like to play with at some point: PictPress (as stated on the wiki) : automatically add thumbnails and pictures for all images in a di […]
August 13th, 2004 at 10:08
cache dir does not create the 100/600 folders for image thumbnails and full view. i’ve added the lines in .htaccess for root
RewriteEngine On
RewriteBase /
RewriteRule ^cache/([0-9]+)/(.*) /pictpress/resize.php?size=$1&path=$2 [QSA]
still nothing. it generates the code fine. but no images get generated for the thumbnails. any help ?
August 20th, 2004 at 00:08
Everything works for me except the thumbnails (i just get a placeholder). Followed all the instructions above. Placed rewrite rules in .htaccess (both in root, and the wordpress directory). Images are there, but no thumbnails. Bummer.
August 27th, 2004 at 10:08
I installed your plugin, and I think the idea of the plugin is great, thought it is not a mature “out of the box” solution yet.
It took me at least 3 hours to make it work as intended…
But maybe I can help, e.g. the plugin doesn’t produce valid XHTML on my site, and I’m gonna fix it asap…
August 28th, 2004 at 10:08
plugin looks promising. thanks, a suggestion/query which might help other commenters: after 30 minutes I couldn’t get it working [sob], even with the suggestions in 6&8 - what would be really useful would be a little debug script which would add a small div to the edit page describing where pictpress is putting things (or expects things to be based on the current config). does such a thingy exist?
September 17th, 2004 at 23:09
The plugin looks neat. Just one problem. Two, really.
I have installed this as normal. I have activated the script in the plugins menu of the admin area. The pictpress.php page loads normally. Placing an echo statement at the end reveals a “loaded!” notice. But placing an echo “$dirname”; command in the pp_add_picture_pages() function does nothing. For some reason the script doesn’t seem to be calling that particular function.
I can “force” it to activate the function by calling it at the bottom of the pictpress.php page. It then reports that everything is in the absolute path plus /images/2004/09/. That’s where it ends. It doesn’t tack on a message title.
I then copied/cut the code to define the directory and stuck it within the loop of the index.php page for wordpress. I wanted to see if it could correctly identify the directory there. Sure enough, it couldn’t. Like before, it couldn’t obtain the message title.
Further experimentation revealed it couldn’t find the message ID in either place. Although as I said, it has no problem finding the correct year, month, and date of the message.
Furthermore, uploading the images and sticking them in the correct directory (images/2004/09/test-pics) and then creating an entry named test-pics doesn’t have any effect. It doesn’t call the pp_add_picture_pages() function. Even putting a die(”Grrr!”) statement in the function results in no effect. The only way I have found for the function to be activated is to force it manually by calling it from the bottom of the pictpress.php page.
So I’m not sure if…
- The general failure to call the function is causing the message ID/title not to load correctly
- The message ID/title failing to load is causing the function to never load
- If I’m facing two problems that are unrelated… and both seemingly beyond my ability to solve.
I have been working on this for hours and now have a very good understanding of how your script works. I’m still at a loss to explain why the function won’t load when by all rights it should be.
Oh, I have also gone through and fixed a few paths that were out of sync with my directory structure. Mostly having to remove the occasional “and” and “..” statements.
Suggestions? I’d really like to get this to work.
–Stephen
PS, I’m doing this on a development server that can’t be reached from the ‘net, so I can’t show you the work in progress, sorry.
September 18th, 2004 at 11:09
I have a new version which should cause less problems, see http://www.curioso.org/2004/09/14/pictpress/
I will close the comments here.
November 19th, 2004 at 09:11
[…] ‚’特定ã®ã‚¹ã‚¿ã‚¤ãƒ«ã§è¡¨ç¤ºã•ã›ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ ピクトプレス(PictPress) 自動的ã«ã€æŠ•稿時ã«ã€ã‚るディレクトリ内ã«ã‚ã‚‹ã™ã¹ã¦ã®ã‚¤ãƒ¡ãƒ […]