Summary: Talk page for ImagesAutoResizing.
Maintainer: PRZ
Users: +1 (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


THANKS! This is a nice feature I've really been waiting for! :-)
Just one question: If the user gave the wrong dimensions at uploadtime: Can he change the sizes later? If not: Is it possible to implement such a feature? - Gerhard

Done on V1.5 PRZ

Since installing v1.3 I get for half of my photo's "invalid file extension". what has happened? (I'm using Mac OSX for server and maintenance. the file extension is .jpg) Han

It seems that a filename with ONLY numbers (like 123.jpg) is no longer accepted. Renaming part of my uploaded photos has solved the problem. Thanks for the quick reaction, Han

Ah, yes, the number is interpreted as the required sized of an empty name. It have been solved on V1.5 by requiring to use only '*' character instead of '.' as separator for size.
Unfortunately, that will broke links of people who have used it for size characterisation. PRZ

Made some changes to the code for a change-proposal anyone may figure out for him/herself what can be of use from it...
Some extra's incorporate limitations to print or publish actions (like when someone is printing, nobody requires deeplinking anyway, however also these links are used to store pages off-line, so in some cases they might be useful.)
I removed the links in there because I used offline-website grabbers to grab the publish content. (or use scripts to create PDF files) and i don't need stuff that won't work out in that matter. Also, I need to patch the script once more to remove WikiWord pages that do not exists yet in that concept. (links that involve "&action=edit")



This is a too special use, so i will not implement anything in the base code. Some suggestions:
To get the action of the URL (or of a post) do $action = @$_REQUEST['action']; (the @ stops the errors)
You can try to add after the line:

  $flpthPlain = str_replace('.s.','.p.',$flpthSmall);

something like:

  if (@$_REQUEST['action']=='publish') $flpthPlain = '';

Which will make like if the plain file don't exist and stop the link (in last version). - untested -

sounds great but everything goes along fine until I click the upload button and i then get:
Call to undefined function imagecreatefromjpeg() in $pmwiki/cookbook/minimage.php on line 283

This happens with any image type, the only difference being that imagecreatefromjpg will change to imagecreatefromgif or imagecreatefrompng etc depending on which type of image i try to upload.

all file locations and permissions are correct.

any ideas how I might get past this stumbling block?


It probably means that the GD image library (which should be over 2.03) is not properly installed in the PHP installation. Without that library, this recipe and all others galleries cannot work.

The text file in the zip has incorrectly formated the include statment. Should be:


Something, minor. BTW, great script, esp for first time! A couple of enhancements that would be nice:

  1. Show the caption under the thumbnail
    1. (24AUG05 update) A work around is to use a float or frame and seperate the image string from the caption with an upright " | " (e.g. %rfloat%Img:Image.ext | caption)
  2. Option for floating the image PB (25Jul05)
    1. (24AUG05 update) Again using the frame floats now available since beta52 and improved in beta55 (e.g. %rframe%Img:Image.ext)

It would be nice to have something like: which provide thumbnails of all the uploaded images of a group.

Would it be possible to set with "$img_smallsize" the '*width*' of displayed image, instead of the larger size of the images? This would make it possible to display the thumbs in a nice evenly spaced collumn.
Thanks, Han, 2 okt 12.43 CEST

I have a bug with this recipe : form submiting did nothing but bring back my PmWiki home. I had to change minimage.php line 249 from:

<form enctype='multipart/form-data' action='\$ScriptUrl' method='post'>


<form enctype='multipart/form-data' action='\$PageUrl' method='post'>

KzarDotNet February 17, 2006, at 03:48 PM

I wish to upload pictures into folder defined in my localmap as Pics.
While Attach:Pics:/test.jpg uploads there, Img:Pics:/test.jpg uploads the file into Uploads/currentgroup folder as a filename Picstest.jpg
Any solution ? Jiri October 19, 2006, at 05:40 AM

Hi I am constantly getting ErrNoResize message after uploading an gif or jpg and setting the Img: markup to the specific file. The attachment itself gets uploaded and can be attached to the page normally. I tried deactivating gif creation set $WriteGif=FALSE; in the minimage script, this didnt help. Any suggestions? Thanks Boris
Most probably the GD library is not installed on your server, so it is not possible to resize images. PRZ March 16, 2007, at 07:00 PM

Seems to work fine, but I do not get an upload form with the image caption/copyright etc as seen above. If I put a fake link in like img:addfile.gif this comes up as a link to upload file and then shows the caption and copyright etc, but does not allow me to change the name of the file from addfile.gif to realname.gif. bouton? Nov 15, 2006

Doesn't work with PmWiki 2.1.27. After uploading a file, it gives Attach:Img:test2.jpg on page render. Bianka? Feb 27, 2007
Never heard of such problem. Works ok for me on recent pmwiki version (2.2.0 beta 38). Some details about your configuration ? PRZ March 16, 2007, at 07:00 PM

In order to get alpha channels working on pngs and maybe even gifs. find $newimage = imagecreatetruecolor($newwidth, $newheight); after add imagealphablending($newimage, false); and find $typeout=$type; after add imagesavealpha($newimage, true); now when thumbs are made of png's with alpha channels there saved. Scotepi June 17, 2007

Can I add any alternate text for small image?

There appears to be a small error in minimage.php. The expression:

	if (@$_POST["Cancel"]) {

should be:

	if (@$_POST["canc"]) {

to match the <input type='submit' name='canc' value=' Cancel ' /> statement.

Talk page for the ImagesAutoResizing recipe (users).