Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Mini-Talk

Summary: Talk Page for Mini recipe
Maintainer: Petko
Categories: Images, Uploads

Picture name under Thumbnail & Automatic Link to new Page?

I have hundreds of images in multiple galleries. i use "mini:*" tag to automatically create those galleries in my pages and it works great, this saves a lot of time!
Now following features would be a great additional benefit:
1) automatic output of each individual image name under each thumbnail picture.
for example: "picture001.jpg" is related to thumbnail with name "th00---picture001.jpg". under this thumbnail image it automatically generates the name of the original source: "picture001".
2) automatic link creation to a new page that is related to each thumbnail picture.
for example: lets name a picture "image001.jpg". on click on it, it directs me to a new page with name "image001". so i dont get a larger version of the picture but a new site where i can add more information, orginal file etc.
Would be really great if those features are possible! Thanks for info! Jack, January 20, 2010, 04:22 PM

Hello - and sorry for the late reply. I am glad to hear that Mini saves you a lot of time. Unfortunately, the features you ask for are not implemented. Both are possible with ThumbList though, (1) is enabled by default, and (2) can be done with an ImageTemplate which contains the line (:include Group.{*$UpFilePage}:) [[Group.{*$UpFilePage}(?action=)edit]] -- this is an advanced feature and needs a little work from you. Good luck! --Petko February 01, 2010, at 10:24 AM

Thanks again! works perfect for me! :) - Jack

Lighbox tweaks???

if i replace the bundled Lightbox javascript with a newer version it stops working in Pmwiki. so i am guessing you have tweaked the bundled Lightbox code Petko? if so, can you document the necessary changes? i ask because i am seeing some odd behavior of the Lightbox close link: it often responds to a click by moving a bit to the left and not closing the image overlay til a second click. anyone else see this? if not, what could i be doing wrong? tia!!! /dan - bang December 17, 2009, at 02:43 PM

Yes, there are some changes for the script to work with the PmWiki's uploads, pub and css directories that need to be parameterizable and not hard-coded. Bigger problem is that the new Lightbox version uses a more recent Prototype release, and it will not work with the older ones. I'll try to find some time to upgrade all to the new version. --Petko December 19, 2009, at 03:59 AM

Remote images

Hi Petko, I'd love to use Mini (or its bigger brother) to display thumbnails of external images. Any chance that we might see that in the future or on how to quickly achieve this? --destotelhorus? October 28, 2009, at 05:17 PM

No, Mini is specifically designed to integrate with PmWiki uploads directories. WikiGallery and QDIG should be able to show thumbnails of pictures on the same server, even out of the PmWiki's uploads structure. I know no PHP online gallery creating thumbnails of pictures on remote servers. But Galleria may be what you want (JavaScript, which means that visitors download all images from the remote site and their browsers scale the pictures down, simulating thumbnails). --Petko October 29, 2009, at 06:58 PM

Would it be possible, instead of linking to remote directories, to link to a subfolder in the uploads directory? I.e., position the images in uploads/Main/randomfolder and then use Mini:randomfolder/someimage.jpg ? ~~ Thanks, Mike

Yes, you can have a sub-directory per-page instead of per-group, see the variable $UploadPrefixFmt in UploadsAdmin. --Petko December 28, 2009, at 03:48 AM

Mini with autogenerated page navigation

Petko, is it possible to create something like on the picture, because I have over 100 pictures and want to separate them on different pages. Of course, I can do it with range but then I must generate the linking pages manully. Thanks for your answer -- MatthiasGünther September 27, 2009, at 8:30 AM

Please look at How to slice a large Mini list into subpages. --Petko September 30, 2009, at 05:52 PM

It's working perfect, thanks a lot -- MatthiasGünther October 05 , 2009, at 12:05 AM

Now I have another question: Is it possible to add << and >> buttons in the perpages, so that the user can navigate to previous respectively next page like it is in ThumbList? --MatthiasGünther October 06 , 2009, at 12:07 AM

Yes, with a different link function like PaginateMini:10 . --Petko October 06, 2009, at 05:52 PM

Again, thousands thanks for your fast support, you are a real wiki-god for me :), hope I will be in the future as fast as you, if some are going to ask for additional features. --MatthiasGünther October 07 , 2009, at 00:45 AM

Displaying pictures attached to more than one page

Petko, If I want to list specific images for display, and I need or want to specify the group.page/filename.jpg for each one, the images do not display. Is this a problem with the code, or with my comprehension? Thanks! -- TeganDowling September 13, 2009, at 12:25 PM

You can display many pictures attached to another page with Mini:Group.Page/1.jpg,2.jpg -- I fixed the demo and added examples to the docs. To list pictures attached to more than one page, you need a Mini: set for each page, like Mini:Page1/1.jpg Mini:Page2/2.jpg. --Petko September 13, 2009, at 12:55 PM

Lightbox not working when Mini is used in SideBar

I'm having trouble using Mini with Lightbox in the SideBar. I want to display one or two thumbs in the SideBar, but when putting them in, Lightbox stops working, although the thumb shows up and they have the rel="lightbox[mini]" argument. In the source code of the page, it's obvious that lightbox isn't loaded at the beginning of the page. I'm having no trouble when using Mini and Lightbox on a normal page. Any idea on how to get this to work? Thanks. --JK? August 28, 2009, at 08:18 AM

I am not sure why this happens, I'll have to find some time to review it. In the meantime, you can add the following in config.php after the include_once('cookbook/mini.php') line:
$HTMLHeaderFmt['lightbox'] = sprintf($Mini['LbJS'], $Mini['LbUrl']);
Thanks. --Petko August 28, 2009, at 09:49 AM

Thanks for the quick reply, it does work now. I'm guessing this is injecting the lightbox css code at anytime. --JK? August 29, 2009, at 06:04 AM

The problem comes from the way PmWiki processes a skin template, see PITS:01139 for details. Yes, the command injects the Lightbox library in all pages. --Petko September 13, 2009, at 02:12 PM

Return to the gallery

When you click on a thumbnail, it opens the original image. Is there a function for clicking on the larger image to return to the gallery? - Ian MacGregor?

No, the readers have to use their browsers' Back button. However, the recipe can be used with Lightbox JavaScript, and it offers better usability. Try it with $Mini['EnableLightbox']=1; [1] --Petko July 13, 2008, at 12:24 AM
Lightbox sounds interesting and may be worth allowing javascript. I'll give Mini+Lightbox a try. - Ian MacGregor?

Links to galleries

IPTC captions

It is an exelent application, but it would be even better for me if the iptc caption field could be used. With this I could easily comment my pictures in Picassa, IrfanView; upload them as a batch and find those comments displayed when looking at the pictures online. Damien September 27, 2008, at 04:18 PM

See this recipe. --Petko September 27, 2008, at 05:33 PM

Random Thanks and Stuff

I have been looking for a solution like this for such a long time. Thank you for such a wonderful work! -- JLuk, October 27, 2008

Thanks for your kind words! --Petko November 23, 2008, at 07:35 PM

Lightbox is not working for me.

I have tried everything but Lightbox seems not to work with my pmwiki (i have the latest version). Maybe there are some bugs in the latest version of 2 december? I spent 2 hours trying to figure out whats wrong but i can't find anything. Maybe there is something wrong with the javascript because i can't see it in the page source code of my website.

Here is part of my configuration file:

 $Mini['EnableLightbox'] = 1;
 $Mini['LbUrl'] = "$FarmPubDirUrl/lb" ; 
 $Mini['LbMaxH'] = 800; $Mini['LbMaxW'] = 800;
 include_once("$FarmD/cookbook/mini.php");

Here is the part from mini.php:

 'EnableLightbox' => 1,
 'Px' => 150,'Quality' => 90,
 'CropXPos' => 0.5, 'CropYPos' => 0.5,
 'LbMaxH'=> 800,'LbMaxW'=> 800,

I followed the documentation and placed mini.php in the cookbook directory and the lb directory in my /pub directory. But Lightbox just doesn't work.

 -- miranon?, 3 december 2008
Hi. First, you should not edit the mini.php file. All settings could be done in config.php and they automatically override the internal variables. This is part of the PmWiki Philosophy #5 -- easier to upgrade to a newer version of Mini. (Set $Mini['Px']=150; in config.php.) Second, I feel the problem comes from your line $Mini['LbUrl'] = "$FarmPubDirUrl/lb" ; where the $FarmPubDirUrl variable may not yet exist; just remove the line. Other possible issue may be that you defined LbMaxH and LbMaxW, but your original pictures are larger than 800 px. If this doesn't help, is there a page I could look at? --Petko December 02, 2008, at 06:23 PM
Lightbox is now working. Thanks!
Hi Petko, everything is working now. I figured out that the reason was my template for pmwiki, i forgot to include the -><!--HTMLHeader-->. Now i have fixed it and everything is working fine. Thanks for your help and tips! Greetings, -- miranon, 3 december 2008

Troubleshooting tips for Lightbox

If Lightbox is not working usually the problems are:

  • Completely blank page:
    = missing PHP function, likely with IPTC, disable IPTC;
    check the server "error log" for messages
  • Thumbnails not created:
    • No links to originals created
      = uploads not found, enable uploads and/or check if the files are visible to PmWiki,
      ie. both Attach:yourpic.jpg and (:attachlist:) should show the pictures.
      Also: file extensions need to be lowercase, .jpg not .JPG
    • Links to originals created, thumbnails created but not shown
      = file permissions on the server directories
    • Links to originals created, thumbnails not shown and not created in the uploads directory
      = PHP Memory limit
  • Thumbnails created, Lightbox not working:
    = Skin needs <!--HTMLHeader--> or <!--HTMLFooter-->
    = $FarmPubDirUrl is incorrect
    = is the lightbox directory from mini.zip copied in pmwiki/pub?

(Tips from Petko on the mailing list on 2010-03-08.)


xmps()

What is this xmps() function on line 207 of mini.php? It seems non-existant neither in PmWiki, nor in PHP... Mini version 20090203.
rogutės, 090215 00:00

mini.php:207: if((xmps(0,0,1)) || !file_exists($mpath) || filemtime($mpath)<filemtime($fpath))

It is a debug function that I use. Sorry, I forgot to clean it up. I just released a new, fixed version. Thanks. --Petko February 14, 2009, at 05:40 PM
Yes, I have noticed that everything runs much much better without it :) A really neat little recipe... So, thank you!
rogutės?

Uppercase extensions

Great extension, very useful and really easy to use.
I have one uncomprehensive behaver: if I use Mini:pic1.JPG,pic2.JPG every thing is fine but if I use Mini:pic* nothing is displayed. If I rename the pics to use ".jpg" and not ".JPG" the Mini:pic* is working.
Is there a parameter limiting the search in "*" case? February 21, 2009, at 07:15 AM

Sorry. Uppercase extensions,as well as filenames with spaces, are not supported, and will not be. It is written in the documentation. If the first markup works, it may be a bug and you shouldn't rely on it, as the bug will be fixed. (The only filenames that should be expected to work with Mini are those that can be displayed inline with Attach:picture.jpg.) --Petko February 21, 2009, at 08:02 AM
I am still using pmwiki-2.1.27 on a Windows Server (that I do not administrate) and their Attach:PicTure.JPG forks fine.
But if You tel me that it may be a bug and is not supported any more in the newer pmwiki versions I should inform my user to principally not use any Uppercase extensions any more. The problem is that often cameras use Uppercase extensions for the filenames and we use ftp-upload for photo galleries so that I can not prevent this based on the pmwiki upload mechanism. Georges Schutz? February 21, 2009, at 08:55 AM
Right, on Windows, filenames are case-insensitive, but on most servers they are not: pic.JPG and pic.jpg can be different files. PmWiki officially supports only lowercase extensions, and if you upload your files via the ?action=upload link, they are renamed to acceptable filenames (lowercase extensions). I am considering adding a variable that will automatically rename existing files with unsupported names, to correct ones. --Petko February 21, 2009, at 09:14 AM
Could be a solution.
Is there a possibility to scan for filename conformity in all side-specific uploads (in all upload directories)? I sow that their is a recipe RecentUploadsLog that I could perhaps use to regularly check the uploads. But does this only show files uploaded by ?action=upload or all files in the multiple upload directories? Georges Schutz? February 21, 2009, at 11:32 AM
As of version 20090321, Mini can autorename existing files to the right filenames, as if you uploaded them via the ?action=upload. --Petko March 21, 2009, at 06:17 PM

a.jpg to c.jpg

I'm running an architecture website (zapgun.pt) using PmWiki engine with a lot of your recipes & tips (Maxi, Mini, UnToggle...). We are grateful towards your work around here (I'm just looking for a beautiful postcard to send ;)
Concerning this Mini feature, since I've frequent images with a year_month_day name and, instead what's your suggestion, organized per directory, I'm wondering if there are any line that produce a Mini:1.jpg(to)6.jpg thumbnail (ex. Mini:2005_05_12-4.jpg(to)2005_11_16.jpg ). I've tried different combinations of your "lists usage" but I didn't get any code that reproduce this effect.
Since my website is constantly changing is difficult to address a definitive link to a Mini gallery usage. For now, if you wish, here you can look to directory that use both the Mini and UnToggle: http://zapgun.pt/wiki/index.php/Bellynavel
Thank you - Tomita, June 05, 2009

Hi. I'm not sure I completely understand what you try to achieve. In your example page, you can use Mini:2006_10_31*,2006_11_16*. For example, to display pictures from one day, you can have Mini:2006_10_31*, or for all pictures from April: Mini:2009_04*. If you use uploads per group, easiest is to have some common prefix or suffix (like a date, or the name of the subject) for all pictures that need to be in one gallery. --Petko June 08, 2009, at 04:41 PM

I didn't make myself clear: what I was asking was about some line that produces images From X To Y (using the abc dictionary index). For instance, I have 01.jpg 02.jpg 03.jpg (...) 50.jpg uploaded but I only want to display in thumbnails images from 05.jpg to 15.jpg; It was very useful, also, if we could use different combination of From>To like: Mini:05.jpg>15.jpg,18.jpg>28.jpg.
This is just because I've noticed that I have, in certain circumstances, to use a lot of -(minus) jpgs and a long list of jpgs to produce a list of the images that I want in thumbnails.
Thank you - Tomita, June 09, 2009

You can add a custom function which slices the Mini set. See Mini_Range. --Petko June 10, 2009, at 11:18 AM

Thanks, obrigado, merci & Много благодаря. This recipe will be very helpful to me. I didn't had time to test it properly, so, I will write my opinion about Mini Range in a few days.
Tomita June 11, 2009

Concerning the chapter "Title and text around the gallery" in Mini Cookbook: Is it possible to have different titles, texts or tooltips for each thumb/frame in the same gallery?
(eg.: Mini:1jpg”This is Picture 1”,2.jpg”This is number 2” etc.)
Because it is very odd to have a single gallery with different subjects without the possibility to have different tooltips (and usually, the picture names, with all the numbers and letters are not very nice to be the shown the name, as the title, for the picture) .

  • You can have Mini:1.jpg"Title 1" Mini:2.jpg"Title 2" Mini:3.jpg"Title 3" or, easier:
    Mini:1.jpg"Title 1" \
    Mini:2.jpg"Title 2" \
    Mini:3.jpg"Title 3"
    Note the backslash \ at the end of each line except the last one.

Concerning the Mini Range recipe: It would be nice to have a crossed features with the command lines available in the mother Mini.
(eg.: Mini_Range:image01.jpg..image04.jpg,*,image06.jpg,ex*,-image02.jpg etc.)
Since my understanding about PHP, HTML, CSS... is near zero I don't have any idea if the above questions are possible or easy to program.

  • This is the case now. You first have FIRST..LAST pictures, then any list, * or ex* or -ex*...

Other thing that I had noticed (but I'm sure that this one is about my inability to deal properly with a correct installation) is that in the local folder with different Group.php instead of the main config.php I can't deal with the Mini Range because of this error: Fatal error: Cannot redeclare umini_range() in /home/zapgun/public_html/wiki/local/Blog.php on line 20
Tomita June 15, 2009

  • If you place the function in config.php, you don't need to add it to any other Group.php file, Mini_Range: will work in all pages. --Petko June 15, 2009, at 01:06 PM

Print out a page with Mini images

Is it possible to have a "print view" for printing out all Mini images in one page?

--cg? 2009-12-18

You can click on the "Print" action link somewhere in the page. Like here. --Petko November 19, 2009, at 03:50 PM


Use tooltip titles for entire list

Hello - first, thanks for the great work. This is exactly precisely what I've been looking for.

Now my question: I'd like to display a list of images in one lightbox gallery, and did this like:

Mini:m1.jpg,m2.jpg,m3.jpg

Now, I'd like to additionally provide tooltip titles - to be displayed within the lightbox presentation. I tried

Mini:m1.jpg"Description one",m2.jpg"Description two",m3.jpg"Description three"

but it doesn't work. Any ideas?

I tried the above suggested:

You can have Mini:1.jpg"Title 1" Mini:2.jpg"Title 2" Mini:3.jpg"Title 3"

but it results in the images not being displayed as a single gallery anymore (I'm using lightbox with parameter "2").

thank you again! Mike

You are correct, this splits the gallery in a number of Mini sets. If you require both individual descriptions and prev-next slideshow, you have to use Lightbox mode 1. --Petko December 28, 2009, at 03:56 AM


Mini and MakeUploadNamePatterns

The Pacific Bulb Society wiki has the first character of uploaded picture file names capitalised. When pmwiki 2.2.6 allowed modifications to uploaded file names, I added: '/^./e'=>'strtoupper("$0")' to $MakeUploadNamePatterns so that the first character would automatically be capitalised.

After a while we noticed that when a page display required a thumbnail to be created, the thumbnail was created but did not display - subsequent page displays working correctly. I've decided that this is because after creating the thumbnail, mini displays it via HandleDownload(), that function applies the MakeUploadNamePatterns to the thumbnail name, we end up with Th00---. I have fixed things by adding another file name mapping:

'/^Th00---/e'=>'"th00---"'

I suspect if I was better at regex I could sort things out with one expression.

The general point is that additions to MakeUploadNamePatterns either have to skip thumbnails or must have no effect on thumbnails, for example forcing extensions to lower case is OK because thumbnails already have lower case extensions.


Talk page for the Mini recipe (users).

Edit - History - Print - Recent Changes - Search
Page last modified on March 10, 2010, at 05:37 AM