phpDivingLog

3rd party extensions (phpDivingLog, dive computer downloader,...)
Post Reply
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote:
Inferno wrote:I push a change to github for the thumb generation.

I saw your files where around 5Mb, so the hardcoded limit was 1,73Mb so what I did:

- Made max file size changeable via the config see max $_config['max_resize_size'], if this setting is too high it may not work on some servers
- If there are files which are too big a message is displayed:

This image is to big to resize: images/pictures/017-DSCF0062-130509.jpg please decrease the filesize to less then: 1.73M or increase max_resize_size in the config
I am stupid...

I resized my image to 1.5 MB. But now I am getting this error message:
Fatal error: Allowed memory size of 33554432 bytes exhausted at /var/tmp/portage/dev-lang/php-5.3.14/work/sapis-build/apache2/ext/gd/libgd/gd.c:201 (tried to allocate 3200 bytes) in /var/www/localhost/htdocs/phpdivinglog/includes/image-resize.php on line 368
Please try even smaller images, since this could be a limitation of your php installation, have to look in detail

My setting in php.ini

memory_limit = 456M
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

Inferno wrote:
Please try even smaller images, since this could be a limitation of your php installation, have to look in detail

My setting in php.ini

memory_limit = 456M
My memory_limit is 512M (running my own server at home) and I am wondering about the error message
Allowed memory size of 33554432 bytes
...

I also changed the picture size to 500k, but still the same issue...
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote:
Inferno wrote:
Please try even smaller images, since this could be a limitation of your php installation, have to look in detail

My setting in php.ini

memory_limit = 456M
My memory_limit is 512M (running my own server at home) and I am wondering about the error message
Allowed memory size of 33554432 bytes
...

I also changed the picture size to 500k, but still the same issue...
I'm now looking at different resize class since this class is not maintained since 2005. So hold on for some moment, now integrating http://www.verot.net/php_class_upload.htm seems maintained
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

Inferno wrote:please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
Ok, working now:

Now I have still two very minor issues:

1) Elevated Pictures are shown with a wrong format as a thumbnail (cross)
Example: First Picture in the Link:
http://tauchen.familie-ebner.at/index.php/38

2) For my dives #22 to #46 I see an error message at the top of the page:

Code: Select all

Warning: Division by zero in /var/www/localhost/htdocs/phpdivinglog/classes.inc.php on line 1878
#1 to #21 and #47 to #49 are ok.
For Information: #1 to #21 are created manually in Diving Log 5.0. #22 to #49 are based on Suunto Cobra 1.
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

ebnerjoh wrote:
Inferno wrote:please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
Ok, working now:

Now I have still two very minor issues:

1) Elevated Pictures are shown with a wrong format as a thumbnail (cross)
Example: First Picture in the Link:
http://tauchen.familie-ebner.at/index.php/38

2) For my dives #22 to #46 I see an error message at the top of the page:

Code: Select all

Warning: Division by zero in /var/www/localhost/htdocs/phpdivinglog/classes.inc.php on line 1878
#1 to #21 and #47 to #49 are ok.
For Information: #1 to #21 are created manually in Diving Log 5.0. #22 to #49 are based on Suunto Cobra 1.
Regarding issue 2 I think I found the issue. In the Logbook-db the value for MaxPPO2 for the false dives is "0" instead of "NULL". Need to check where to change this in diving log 5.0...
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote: 1) Elevated Pictures are shown with a wrong format as a thumbnail (cross)
Example: First Picture in the Link:
http://tauchen.familie-ebner.at/index.php/38
Fixed on github, please delete all your current thumb_* files
Last edited by Inferno on Fri Jul 13, 2012 15:58, edited 1 time in total.
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

ebnerjoh wrote:
ebnerjoh wrote:
Inferno wrote:please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
Ok, working now:

Now I have still two very minor issues:

1) Elevated Pictures are shown with a wrong format as a thumbnail (cross)
Example: First Picture in the Link:
http://tauchen.familie-ebner.at/index.php/38

2) For my dives #22 to #46 I see an error message at the top of the page:

Code: Select all

Warning: Division by zero in /var/www/localhost/htdocs/phpdivinglog/classes.inc.php on line 1878
#1 to #21 and #47 to #49 are ok.
For Information: #1 to #21 are created manually in Diving Log 5.0. #22 to #49 are based on Suunto Cobra 1.
Regarding issue 2 I think I found the issue. In the Logbook-db the value for MaxPPO2 for the false dives is "0" instead of "NULL". Need to check where to change this in diving log 5.0...
Changed in Diving Log the Details for Air from "Air(O2=21%)" to "Air". Now this issue is gone.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote: Changed in Diving Log the Details for Air from "Air(O2=21%)" to "Air". Now this issue is gone.
Strange, do you have o2_default in your config?


/**
* default O2 %
*/
$_config['default_o2'] = 20.9;
$_config['default_maxppo2'] = 1.6;
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

Inferno wrote:please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
Antoher strange problem...

First time everything was ok, but then I had to change something and I deleted all images and uploaded them again. I took your default config and changed the size of the thumbs to 200x120 and the pic-width to 1024.

Code: Select all

$_config['divepics_preview'] = true;

/**
 * Enable resizing of the uploaded pictures by GD
 * If set to false, full size images will be shown and the
 * thumbnails will be generated each time (cpu usage)
 */
$_config['enable_resize'] = true;

/**
 * Set this to true to use the new resize class from http://www.verot.net/php_class_upload.htm
 * Not fully tested, so this option is here temporarly
 */
$_config['new_resize_class'] = true;

/**
 * Max filesize of images which are resized, this setting is depending on your server
 * and php settings
 */
$_config['max_resize_size'] = 1812000;

/**
 * Set the maximum width and height of the thumbnails, which are created automaticly
 * Usually a 4:3 ratio, e.g. 100:75, 120:100
 * Width and height are set in px
 */
$_config['thumb-width'] = 120;
$_config['thumb-height'] = 100;

/**
 * Set the maximum width of the pictures in the gallery
 * Width is set in px
 */
$_config['pic-width'] = 1024;

/**
 * get exif data from the images
 */
$_config["get_exif_data"] = true;

If I then access the website --> Dive Gallery, the image-tool tries to resize the original images to a layout of 200x150...
Due to the fact that the image-tool doesnt have the rights to overwrite the original files it is running in a loop.

Code: Select all

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/localhost/htdocs/phpdivinglog/includes/pear/Event/Dispatcher.php on line 249
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.3.14-pl0-gentoo
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 512M (536870912 bytes)
- language : en_GB
source is a local file /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
    MAGIC path defaults to /usr/share/file/magic
    Fileinfo PECL extension failed (finfo_open)
- Checking MIME type with UNIX file() command
    MIME type detected as image/jpeg; charset=binary by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
    file_src_name : IMG_0111.JPG
    file_src_name_body : IMG_0111
    file_src_name_ext : JPG
    file_src_pathname : /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
    file_src_mime : image/jpeg
    file_src_size : 1470878 (max= 536870912)
    file_src_error : 0
- source file is an image
    image_src_x : 3648
    image_src_y : 2736
    image_src_pixels : 9980928
    image_src_type : jpg
    image_src_bits : 8
process file to /var/www/localhost/htdocs/phpdivinglog/images/pictures/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
    file_dst_path : /var/www/localhost/htdocs/phpdivinglog/images/pictures/
    file_dst_name_body : IMG_0111
    file_dst_name_ext : JPG
- no auto_rename if same filename exists
- destination file details
    file_dst_name : IMG_0111.JPG
    file_dst_pathname : /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
- no overwrite checking
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
    check x/y sizes
    resized image object created
    image_src_x y : 3648 x 2736
    image_dst_x y : 200 x 150
- converting...
    fills in transparency with default color
- saving image...
- error: No JPEG create support.
error : No JPEG create support. 
But if I access the images via a logbook entry, the images are shown correctly: Thumbs, resized images and full size.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote:
Inferno wrote:please download the latest version from github, new resize class is imported, also make sure you add this to your configuration:

$_config['new_resize_class'] = true;
Antoher strange problem...

First time everything was ok, but then I had to change something and I deleted all images and uploaded them again. I took your default config and changed the size of the thumbs to 200x120 and the pic-width to 1024.

Code: Select all

$_config['divepics_preview'] = true;

/**
 * Enable resizing of the uploaded pictures by GD
 * If set to false, full size images will be shown and the
 * thumbnails will be generated each time (cpu usage)
 */
$_config['enable_resize'] = true;

/**
 * Set this to true to use the new resize class from http://www.verot.net/php_class_upload.htm
 * Not fully tested, so this option is here temporarly
 */
$_config['new_resize_class'] = true;

/**
 * Max filesize of images which are resized, this setting is depending on your server
 * and php settings
 */
$_config['max_resize_size'] = 1812000;

/**
 * Set the maximum width and height of the thumbnails, which are created automaticly
 * Usually a 4:3 ratio, e.g. 100:75, 120:100
 * Width and height are set in px
 */
$_config['thumb-width'] = 120;
$_config['thumb-height'] = 100;

/**
 * Set the maximum width of the pictures in the gallery
 * Width is set in px
 */
$_config['pic-width'] = 1024;

/**
 * get exif data from the images
 */
$_config["get_exif_data"] = true;

If I then access the website --> Dive Gallery, the image-tool tries to resize the original images to a layout of 200x150...
Due to the fact that the image-tool doesnt have the rights to overwrite the original files it is running in a loop.

Code: Select all

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/localhost/htdocs/phpdivinglog/includes/pear/Event/Dispatcher.php on line 249
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.3.14-pl0-gentoo
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 512M (536870912 bytes)
- language : en_GB
source is a local file /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
    MAGIC path defaults to /usr/share/file/magic
    Fileinfo PECL extension failed (finfo_open)
- Checking MIME type with UNIX file() command
    MIME type detected as image/jpeg; charset=binary by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
    file_src_name : IMG_0111.JPG
    file_src_name_body : IMG_0111
    file_src_name_ext : JPG
    file_src_pathname : /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
    file_src_mime : image/jpeg
    file_src_size : 1470878 (max= 536870912)
    file_src_error : 0
- source file is an image
    image_src_x : 3648
    image_src_y : 2736
    image_src_pixels : 9980928
    image_src_type : jpg
    image_src_bits : 8
process file to /var/www/localhost/htdocs/phpdivinglog/images/pictures/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
    file_dst_path : /var/www/localhost/htdocs/phpdivinglog/images/pictures/
    file_dst_name_body : IMG_0111
    file_dst_name_ext : JPG
- no auto_rename if same filename exists
- destination file details
    file_dst_name : IMG_0111.JPG
    file_dst_pathname : /var/www/localhost/htdocs/phpdivinglog/images/pictures/IMG_0111.JPG
- no overwrite checking
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
    check x/y sizes
    resized image object created
    image_src_x y : 3648 x 2736
    image_dst_x y : 200 x 150
- converting...
    fills in transparency with default color
- saving image...
- error: No JPEG create support.
error : No JPEG create support. 
But if I access the images via a logbook entry, the images are shown correctly: Thumbs, resized images and full size.
I will add an check if the file can be written before. Are the thumbs you see the new size or still the old size?
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

Inferno wrote:
I will add an check if the file can be written before. Are the thumbs you see the new size or still the old size?
Yes, the thumbs are shown in the correct (small) size. This is ok.

What would be great: Something like gallery2 or compareable. It would be cool if it is possible to upload the original files, but If you click on the thumb you will only get a smaller image and only if you click inside the image on a button that the full size is shown.

Now, if you click on a thumb, you will get a resized image, but it seems the browser is downloading the original size.

Btw. do you have a "donate" button? You are realy doing a good job.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

ebnerjoh wrote:
What would be great: Something like gallery2 or compareable. It would be cool if it is possible to upload the original files, but If you click on the thumb you will only get a smaller image and only if you click inside the image on a button that the full size is shown.

Now, if you click on a thumb, you will get a resized image, but it seems the browser is downloading the original size.

Btw. do you have a "donate" button? You are realy doing a good job.
- Tried to look for an off the shelf gallery application, however I didn't find an package which would fit in nicely and without lots of coding. One thing which worked, was setting a user defineable field in divelog which points to a gallery album. However I liked this more.

- The browser is downloading the thumbs, however to make viewing the images more fluid, highslide is perloading the first five images. So it is not dowloading all images
=> http://highslide.com/ref/hs.numberOfImagesToPreload
If you want an option to disable this, I could make this configurable

=> for the moment no donate button, since I like to do this kinds of things when I have time. When people are sending me gifts/money they expect things from me and when my normal day job is too demanding or I fancy doing some other things. I don't give support.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog

Post by Inferno »

Check if files can be written is on Github now
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: phpDivingLog

Post by ebnerjoh »

Inferno wrote: - Tried to look for an off the shelf gallery application, however I didn't find an package which would fit in nicely and without lots of coding. One thing which worked, was setting a user defineable field in divelog which points to a gallery album. However I liked this more.

- The browser is downloading the thumbs, however to make viewing the images more fluid, highslide is perloading the first five images. So it is not dowloading all images
=> http://highslide.com/ref/hs.numberOfImagesToPreload
If you want an option to disable this, I could make this configurable
No, I think this is ok. I resized my images and I have the originals on my main gallery.
Inferno wrote: => for the moment no donate button, since I like to do this kinds of things when I have time. When people are sending me gifts/money they expect things from me and when my normal day job is too demanding or I fancy doing some other things. I don't give support.
I fully understand. Maybe better then a "donate money" is a "donate beer" button :-)


I have now just two topics/questions:
1) I saw, that the language can be changed, is german available?
2) I have only at the "Dive City" the possibility to show a dive map, not at the "Dive Location" although there is a DB-Entry for that.
Post Reply