EasyGallery-Talk

Summary: Talk page for EasyGallery.
Maintainer: Klonk Martin Fick
Users: (View / Edit)

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

Comments

Is there also a way to automatically generate the names within the table ? (something like: for $numb=1 to 67 ... attach:Pic$numb.jpg) ??? Yes there might be using the Clipboard and the (:index:) markup.


  • Just for information
    Here is how I did my gallery:
  • Create a new group: Gallery
  • Use Gallery.Gallery to hold links and descriptions to all sub-galleries
  • In each sub-gallery, create a page to hold the thumbnails, see the markup used below
(:table border=1 width=100% align=center bgcolor=#f2f2f2 cellspacing=0 cellpadding=2 :)
(:cellnr colspan=2 align=center:)
'''Tux'''
(:cellnr align=center:)
%newwin%[[Attach:crystal-tux-lt.png|Attach:crystal-tux-lt_thumb.png]]%%
(:cell align=center:)
%newwin%[[Attach:crystal-tux-rt.png|Attach:crystal-tux-rt_thumb.png]]%%
(:cellnr align=center:)
Filename: crystal-tux-lt.png\\
Desciption: Tux, facing left\\
Demensions: w 250 x h 304\\
File size: 52.1KB
(:cell align=center:)
Filename: crystal-tux-rt.png\\
Desciption: Tux, facing right\\
Demensions: w 250 x h 304\\
File size: 52.2KB
(:tableend:)

Tux

Filename: crystal-tux-lt.png
Desciption: Tux, facing left
Demensions: w 250 x h 304
File size: 52.1KB
Filename: crystal-tux-rt.png
Desciption: Tux, facing right
Demensions: w 250 x h 304
File size: 52.2KB

That was pretty much all I did. The most time-consuming part was writing the individual text for each pic instead of having PmWiki fill it in for me. I wonder how hard it would be to implement, into PmWiki, a way to resize photos and auto-include file info and descriptions for each pic. Ian MacGregor

You may add the following lines to your config.php (there's probably an easier way... but is works):

    Markup(
'filesize',
'directives',
"/\\(:filesize\\s+([-\\w.]+)\\s*:\\)/e",
"Keep( GetSize( \"$1\" ) )"
);
function GetSize ( $file ) {
global $pagename, $UploadDir;
list( $group, $page ) = explode('.', $pagename);
$size = filesize( "$UploadDir/$group/$file" );
$kb = sprintf( "%01.2f", $size / 1024 );
return $kb . " kB";
}

Now, you can add a markup instead of the file size:

(:filesize crystal-tux-rt.png:)

You should get the size of the file in kByte. Bianka

To add on to this, you can use the ImageMagick utility identify to give you the info:
                     $ identify -format '%b|%h|%w' pic1.jpg
                     3.1mb|4288|2848
which you can execute from your GetSize function above and easily unpack the 3 data items.
- tamouse June 03, 2011, at 07:29 PM

Talk page for the EasyGallery recipe (users).

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_COOKIE] => imstime=1777636001; PHPSESSID=9pofbsvhuiee15o1poo99m27u6
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2fEasyGallery%2dTalk
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2fEasyGallery%2dTalk
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/EasyGallery-Talk
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook/EasyGallery-Talk
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afSStd6O7ff8BMYqhZC4YQAAAMc
            [REDIRECT_URL] => /wiki/Cookbook/EasyGallery-Talk
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 38638
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook/EasyGallery-Talk
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/EasyGallery-Talk
            [SCRIPT_URL] => /wiki/Cookbook/EasyGallery-Talk
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afSStd6O7ff8BMYqhZC4YQAAAMc
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777636021.5889
            [REQUEST_TIME] => 1777636021
            [argv] => Array
                (
                    [0] => n=Cookbook%2fEasyGallery%2dTalk
                )

            [argc] => 1
        )

)