WebsiteBaker Community Forum

WebsiteBaker Support (2.10.x) => Modules => Topic started by: Ruud on January 09, 2018, 01:51:59 PM

Title: Minigallery (v2.5.0) - better again
Post by: Ruud on January 09, 2018, 01:51:59 PM
Minigallery (v2.5.0) now has the possibility to sort the images. No more naming the images to get them in the correct alphabetical order.
Just drag and drop them around in the backend and sorting is done.

Since version 2.4.0 a new justify script was added that is used for both the square thumbnails as well as when they are different sized.

Captions are also added and the possibility to delete per single image is there now (since version 2.3.0).
Bulk upload was the other big improvement of that version. Just drop your complete album in the module upload section and it should work.

Info and download: https://dev4me.com/modules-snippets/opensource/minigallery-v2/


(https://dev4me.com/media/minigal2/222/thumbs/002-upload.jpg) (https://dev4me.com/media/minigal2/222/thumbs/004-captions.jpg) (https://dev4me.com/media/minigal2/222/thumbs/011-sorting-thumbs.jpg) (https://dev4me.com/media/minigal2/222/thumbs/009-frontend-mobile.jpg)
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on January 09, 2018, 02:51:15 PM
 (Y)
Work very nice. Just tested with WebsiteBaker 2.11 under php7.1.11
Title: Re: Minigallery (v2.5.0) - better again
Post by: dbs on January 09, 2018, 06:40:45 PM
My client is happy with the new version.
I didn't explain anything. It was intuitive enough.  (Y)

Thank you, Ruud!
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on May 25, 2018, 10:51:26 AM
Minigallery 2.5.1 throws the following error in the error log
Code: [Select]
Fri, 25 May 2018 08:37:11 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
WebsiteBaker 2.12
php 7.2.1
strikt no

What can I do?
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on May 25, 2018, 11:33:43 AM
Minigallery 2.5.1 throws the following error in the error log
Code: [Select]
Fri, 25 May 2018 08:37:11 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
The message just means it is trying to check a file that is either no image or a corrupted imagefile.
So, you could check the folder for invalid files.
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on May 25, 2018, 11:38:47 AM
Okay, thanks for the hint. In the FE the pictures are all to see and in the BE I have updated all images again. The message remains unfortunately.
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on May 25, 2018, 11:51:49 AM
It could be some other file was uploaded or created..
Using "delete all" in the module should remove the complete folder and create a new one.

The error (notice) could be handled better by minigal2.
You can try to modify line 210 in functions.php ( /modules/minigal2/functions.php )
Code: [Select]
if(@!is_array(getimagesize($filename))){into
Code: [Select]
if(!is_array(@getimagesize($filename))){
That might help suppressing the message.
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on May 25, 2018, 12:15:15 PM
I have deleted all images, the directories wash empty afterwards.
I changed the line 210 so.
Then the pictures uploaded again via the BE from the module and the pictures updated.
The error message still appears.

It's about this site
https://reverend-biola.org/
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on May 25, 2018, 12:50:25 PM
Have now tested the php version of 7.2 to 7.1 and 7.0, the error message remains unfortunately.
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on May 25, 2018, 01:02:29 PM
Have now installed a fresh Wb 2.12 with php 7.2 and minigallery 2.5.1.
These error messages come only with the installation of the module minigallery

Code: [Select]
Fri, 25 May 2018 10:57:01 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
Fri, 25 May 2018 10:57:25 +0000 [E_NOTICE] /modules/minigal2/save.php:[77] from /modules/minigal2/save.php:[77] WbErrorHandler "Undefined index: PAGES"
Fri, 25 May 2018 10:57:27 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!""

Where the second message is fixed quickly, strange are the messages to pictures that have not yet been uploaded ??
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on May 25, 2018, 02:02:09 PM
The message is shown by WB when your error-reporting is set to "Development" mode.
For some reason WB switches off the standard way of suppressing errors (using the @ character) when this setting is used.

So, nothing wrong. Just a little bit too critical error reporting.
Title: Re: Minigallery (v2.5.0) - better again
Post by: noname8 on August 24, 2018, 08:34:21 AM
Somehow the minigallery sorting does not work.
I can't explain it, i have inserted the photos with sort numbers about 9000 but seems it has no effect.
Manually dragging file works, but number to sql comes 99 107 or similiar.

In the code there is sort parameter many place but no sort setting in the admin gallery settings ?
Title: Re: Minigallery (v2.5.0) - better again
Post by: noname8 on August 24, 2018, 09:17:23 AM
so the sorting is not the number but | list in the settings.


Found a bug, when you delete image the description row in the mod_minigal2img table does not get deleted
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on August 24, 2018, 10:29:22 AM
Somehow the minigallery sorting does not work.
I can't explain it, i have inserted the photos with sort numbers about 9000 but seems it has no effect.
Manually dragging file works, but number to sql comes 99 107 or similiar.
Not really sure what you mean here..

Remember that for sorting routines 10000 comes before 99.
Sorting is initially done per filename characters , so the 1 from 10000 is lower than the 9 from 99.
If you want to sort numeric imagenames correctly use 00001, 00002 etc..

After this first load the sorted filenames are stored in the settings and you can drag&drop them around for manual sorting. Any additional uploads will be appended behind the existing sortlist (sorted on filename) whenever the images are reloaded (either backend/frontend page refresh).

In the code there is sort parameter many place but no sort setting in the admin gallery settings ?
There is a field "sorting" in the wb_mod_minigal2 table. It is created on module install or when upgrading from older versions.

Found a bug, when you delete image the description row in the mod_minigal2img table does not get deleted
This is not a bug, it is intentionally kept to be able to use the same caption whenever the same image (or complete gallery) is uploaded again (replaced).
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on December 19, 2018, 01:22:56 PM
Hello Ruud
The miniGallery 2.5 writes the following message to the errorlog
Code: [Select]
[E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!""Is there a solution to this?

PHP-Version: 7.2.11
WebsiteBaker-Version: 2.12.1 -r188
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on December 19, 2018, 01:41:42 PM
Code: [Select]
[E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!""Is there a solution to this?

Try changing line 210 in functions.php from
Code: [Select]
if(@!is_array(getimagesize($filename))){into
Code: [Select]
if(@!is_array(@getimagesize($filename))){
That might fix the notice in the errorlog.
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on December 19, 2018, 01:54:46 PM
Changed the code, the message stays the same.
Page reloaded with F5 and ctrl+F5
The code now looks like this:
Code: [Select]
if (!function_exists('isImageFile')) {
function isImageFile($filename) {
      //if(@!is_array(getimagesize($filename))){
if(@!is_array(@getimagesize($filename))){
return false;
}
return true;
}
}
Title: Re: Minigallery (v2.5.0) - better again
Post by: Gast on December 19, 2018, 02:10:14 PM
Quote from: hgs
Changed the code, the message stays the same.
your PHP-Error in WB-Options is set to "Developer" or "Production"?
Title: Re: Minigallery (v2.5.0) - better again
Post by: hgs on December 19, 2018, 02:45:18 PM
PHP-Error in WB-Options is  "Developer"
because it is a developer environment and there WebsiteBaker is tried to code without "messages" in the ErrorLog.
For testing purposes we also install all modules from our own repro and popular modules there.
Title: Re: Minigallery (v2.5.0) - better again
Post by: Gast on December 19, 2018, 02:55:31 PM
see readme since WB 2.10.0

Quote
Extended error handling
    The already existing error handling in WB 2.10.0 has been extended by a few setting possibilities.
    The error reporting setting in the WB options has been re-enabled.
    The following settings are possible:
   

    "Switched Off" = No error messages.
    "Production Mode" = All error messages are not suppressed by the @error control operator.
    "Developer Mode" = Show all error messages, even those with @error control operator.

the @ is a allowed php-error control operator and in use, if you know, a empty answer for a special request is possible, but not the standard answer.
it's not a real error, it's a info, that you suppress somewhere a information from the script with the @error control operator.
Title: Re: Minigallery (v2.5.0) - better again
Post by: noname8 on January 19, 2019, 08:42:22 PM
This worked before, but now i tried it again, in php 7.2 server
when "refresh images"
any ideas ? tried already  chmodding the folder
Code: [Select]
Warning: imagecreatetruecolor(): Invalid image dimensions in /var/www/xxxx/modules/minigal2/functions.php on line 169

Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /var/www/xxxx/modules/minigal2/functions.php on line 187

Warning: imagejpeg() expects parameter 1 to be resource, boolean given in /var/www/xxxx/modules/minigal2/functions.php on line 195

Warning: imagedestroy() expects parameter 1 to be resource, boolean given in /var/www/xxxx/modules/minigal2/functions.php on line 203

this seems to be some kind of problem of my php / website baker creating dir & filesthat does not have enough permissions..
Title: Re: Minigallery (v2.5.0) - better again
Post by: Ruud on January 19, 2019, 11:20:37 PM
Tried to reproduce the warning on PHP 7.2.13. (minigal2 v2.5.1)
For me it seems to work ok. No problems or warnings.

The warning is caused because the function "imagecreatetruecolo r" is called with wrong parameters.
These parameters are basically created by the call in line 102 ( $info = getimagesize($source); )
The manual for the PHP function getimagesize (http://www.php.net/getimagesize) says to be sure the file is a valid image or it will giive unexpected result (without failure). So it could be one of the images in the directory is corrupt or not an image at all.

Title: Re: Minigallery (v2.5.0) - better again
Post by: Gast on January 20, 2019, 01:10:23 PM
possible, that you add some pic's via FTP there? maybe, a hidden file inside of this folder (not every ftp-client show all files in the default settings).
i test it with different PHP-Version (7.2.0, 7.2.8, 7.3.0), no problems

this part of the script build's the preview-thumbs for this section
the 4 warnings in your last message show's everywhere the same problem. this four functions works with a path or the informations from there. (for example: if getimagesize() has no informations about the size, this size is missing in the next function imagecopyresampled() ). equal in all this functions is the source path to the image. Ruud write the answer: a image (or the info inside of the image) is broken or the selected file is not an image

try to call all images in this folder step by step in a browser. you can also delete all the thumbs in this yolder /media/minigal2/[your-section-id]/thumbs and reload the section in you wb-backend again, then compare the pictures in this picture folder with the pictures in the thumb-folder. normalize, the script breaks in this step with the result, that one pic is missing in the thumb-folder - so you found the source picture with the problem

if the problem coms again, we can set some exeption inside of this function, so that you see, what the source is
Title: Re: Minigallery (v2.5.0) - better again
Post by: henri on January 20, 2019, 08:25:46 PM
PHP-Version: 7.2.13
WebsiteBaker-Version: 2.12.1 -r188

MiniGallery Version 2.5.1 tested with 16 images.
No error messages in WebsiteBaker Error log.
Setting PHP error level: Production.

If I set PHP error level to: Development
Then I get the following error messages

Sun, 20 Jan 2019 19:18:00 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
Sun, 20 Jan 2019 19:18:01 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
Sun, 20 Jan 2019 19:18:01 +0000 [E_USER_DEPRECATED] /framework/class.frontend.php:[335] from /modules/droplets/droplets.php(34) : eval()'d code:[5] frontend->preprocess "invalid method call: frontend::preprocess""
Title: Re: Minigallery (v2.5.0) - better again
Post by: henri on January 20, 2019, 09:24:32 PM
PHP-Version: 7.2.13
WebsiteBaker Version: 2.12.1 -r188

Corresponds to error message with MiniGallery 2.5.1

Also Foldergallery v3.0.14 tested with 12 images.
Setting PHP error level: Production.
Setting PHP error level: Development.

No error messages in WebsiteBaker Error log.

Title: Re: Minigallery (v2.5.0) - better again
Post by: dbs on January 20, 2019, 09:45:11 PM
Quote
Sun, 20 Jan 2019 19:18:00 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"
Sun, 20 Jan 2019 19:18:01 +0000 [E_NOTICE] /modules/minigal2/functions.php:[210] from /modules/minigal2/functions.php:[28] isImageFile "getimagesize(): Read error!"

Hello, this was answered some postings before:
Quote from: Ruud
The message is shown by WB when your error-reporting is set to "Development" mode.
For some reason WB switches off the standard way of suppressing errors (using the @ character) when this setting is used.

So, nothing wrong. Just a little bit too critical error reporting.
Title: Re: Minigallery (v2.5.0) - better again
Post by: henri on January 21, 2019, 03:44:30 PM
Sorry,

I had done this test on Ruud's message
Reply # 21 on: January 19, 2019, 11:20:37 PM