Maxi-Talk

Summary: Talk page for the Maxi image viewer
Maintainer: Petko

Your comments are welcome.


Php 7.2 Warning

Hi Petko, may I ask the 7.2 update? Actually Maxi partially works, I have this message:

  • Deprecated: Function create_function() is deprecated in .../pmwiki.php on line 481
Frank June 01, 2018, at 11:21 PM

Updated, thanks. --Petko June 02, 2018, at 05:25 AM

Thank you.

Frank June 02, 2018, at 06:01 AM

I needed to use Maxi with hi-DPI (a.k.a. “retina”) assets—i.e. images that ought to be displayed at a width/height that is some fraction of their actual pixel dimensions (such that, on hi-DPI screens, each pixel of the image will be displayed using 1 physical pixel, to take advantage of the greater pixel density).

Here is my version: maxi_scale.zipΔ. It adds a config parameter, $Maxi['MaxiScale']; this defaults to 1, but you might set it to 2 (the most common alternate value) if you're using 2x assets, etc. Both the small and the large image are scaled appropriately, and the panning algorithm is also adjusted, etc. (Note that this assumes that all the images you use with Maxi are going to be at the specified scale; perhaps a future enhancement might be to allow specifying scale on a per-image basis via the markup.)

Said Achmiz December 23, 2017, at 01:16 PM

I prefer not to include this change because the CSS calc() feature is missing, buggy or inconsistent with older and not so old browsers. --Petko


A common thing nowadays is to set all elements to box-sizing: border-box;; (see e.g. here for advice to do this; and I do it in all my skins and websites).

BUT this causes a weird bug with Maxi, where the image shrinks every time the mouse crosses the border, and the padding is missing on the right and bottom!

The solution is:

.maxi { box-sizing: content-box; }

Perhaps the recipe could inject this style via HTMLStylesFmt, to prevent anyone using a skin or installation with box-sizing: border-box; set on all elements from experiencing this bug?

Said Achmiz December 01, 2017, at 10:28 PM

Added in maxi.css for version 20171203, thanks! --Petko December 03, 2017, at 02:50 PM


Wow, that's totally awesome! However, if I may suggest a small improvement: how about an option to add a small "margin" around the image so that you can see the borders of the image without having to try and keep the mouse cursor on the image. For instance the timelines at the edge of the images on your examples page ( http://tl.5ko.fr/X/2 ) are hard to read if you don't have a steady hand. Fritz Webering April 07, 2009, at 08:02 AM

Thanks. It is possible, I have yet to add it to the documentation. Set in config.php $Maxi['MaxiPadding'] = 50; for 50 pixels around the large picture. The default padding is 20 px which seemed to me a good compromise. --Petko April 07, 2009, at 08:12 AM


To prevent the access of non authorized users to the index list of the upload directory I've followed the instructions on uploads admin and moved the uploads directory to the same level of the /Public_html/ path and added the lines $EnableDirectDownload=0; and $EnableUploadGroupAuth = 1; to config.php
Somehow, after that, the Maxi had stopped working. The smaller image is there and the mouse pointer change to the Maxi's cross but the larger one only appear with a double click on the smaller image.
Can you help me on that? Here you have an example of maxi feature on my wiki: http://zapgun.pt/wiki/index.php/AlmasII/HomePage
Thank You, Tomita July 20, 2009
(Have you received our Porto postcards for your wonderful recipes?)

Hi. Thanks for your report, this should be fixed in the latest version 20090722. And thanks for your postcards, I was very happy to receive them -- if I come to Porto, maybe we could have a beer and talk about architecture. :-) --Petko July 22, 2009, at 05:07 PM

Talk page for the Maxi recipe (users).