• [MOD] Histogram 4 0 5 1
Currently:  

Author Topic: [MOD] Histogram  (Read 221937 times)

0 Members and 1 Guest are viewing this topic.

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: [MOD] Histogram
« Reply #105 on: December 22, 2007, 10:17:58 PM »
Over the past few days I have in my log the error: PHP Warning: Division by zero in / home / miweb.com / data / htdocs / gallery / histo.php on line 71, 72, 73, 74, 75 ..... ..

(I have been two years without that error)

These lines are:

Quote
                                imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
                                imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
                                imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
                                imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
                                $ry=157-($r[$i]/$max_rgb);
                                $gy=157-($g[$i]/$max_rgb);
                                $by=157-($b[$i]/$max_rgb);
                        }
                        imageLine($im_out,13,158,270,158,$hist);
                        imageLine($im_out,13,6,270,6,$hist);
                        imageLine($im_out,13,6,13,158,$hist);

                        imageLine($im_out,270,6,270,158,$hist);

Versión de PHP is:  4.4.7 

Any thoughts?


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Histogram
« Reply #106 on: December 22, 2007, 11:16:36 PM »
What is exact line for division zero error ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: [MOD] Histogram
« Reply #107 on: December 23, 2007, 10:55:58 AM »
Quote
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  imagecreatefromjpeg(reportero.jpg) [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: failed to open stream: No such file or directory in /home/miweb.com/data/htdocs/galeria/histo.php on line 37
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  imagesx(): supplied argument is not a valid Image resource in /home/miweb.com/data/htdocs/galeria/histo.php on line 38
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 53
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 54
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Wrong parameter count for max() in /home/miweb.com/data/htdocs/galeria/histo.php on line 55
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 71
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 72
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 73
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 74
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 75
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 76
[Sun Dec 23 01:48:13 2007] [error] PHP Warning:  Division by zero in /home/miweb.com/data/htdocs/galeria/histo.php on line 77

Lines 37 and 38:

Quote
                        $im=imagecreatefromjpeg($hist_path.$hist_image);
                        for($i=0;$i<imagesx($im);$i+=2)

Lines 53 to 55:

Quote
                        $m[0]=max($r);
                        $m[1]=max($b);
                        $m[2]=max($g);

Lines 71 to 77:

Quote
                                imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
                                imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
                                imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
                                imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
                                $ry=157-($r[$i]/$max_rgb);
                                $gy=157-($g[$i]/$max_rgb);
                                $by=157-($b[$i]/$max_rgb);

This happens to me in two different galleries, but the best thing is that if the histogram is generated .....

I think it's problem of the library gd2 .... I do not know.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Histogram
« Reply #108 on: December 23, 2007, 01:11:55 PM »
Quote
I think it's problem of the library gd2 .... I do not know.

Is show error for one image or all image ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: [MOD] Histogram
« Reply #109 on: December 23, 2007, 10:56:16 PM »
Hello Thunderstrike

It happens with new images or old, it does sometimes with any image.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Histogram
« Reply #110 on: December 23, 2007, 10:59:00 PM »
If check in FTP for file structure - all ok in thumb and media folder ? Is look like alter image ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline bacterio

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: [MOD] Histogram
« Reply #111 on: December 23, 2007, 11:02:10 PM »
No, it's not a problem for permits, are all 777 and passes in any category.

I have two galleries 4homepages on the same server and I ocrre the same. Since a few days ago.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Histogram
« Reply #112 on: December 23, 2007, 11:19:50 PM »
Quote
No, it's not a problem for permits, are all 777 and passes in any category.

I no ask for permission. I ask if file structure is ok (kb, bytes) for all file. Is possible some alter image ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

skiemor

  • Guest
Re: [MOD] Histogram
« Reply #113 on: January 19, 2008, 07:23:40 PM »
Danke, sehr schöner MOD!  :D

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Histogram
« Reply #114 on: January 26, 2008, 11:39:02 AM »
@all
... I redesigned this MOD with some fixes ...
... you can download all neccesary files and the installations instruction ... here ...

@alle
... ich habe den MOD neu gestaltet mit einigen Fixes ...
... du kannst alle notwendigen Dateien und die Installationsanweisung downloaden ... hier ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline rubberduck

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Reptilienmanager.de
Re: [MOD] Histogram
« Reply #115 on: January 26, 2008, 03:48:40 PM »
Wenn es um die Global Sache geht, dann füge mal in die erste Zeile der histogramm.php

Code: [Select]
$hist_image_id = $_GET['hist_image_id'];
ein.

ReptilienManager.de - Die Online Reptilien Verwaltung
Neueinsteiger.eu - Das Portal für Terraristik Einsteiger
Terra-ROW.de - Der regionale Terraristik Stammtisch in Rotenburg

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Histogram
« Reply #116 on: January 26, 2008, 04:09:57 PM »
Hallo Ivan,

Wenn es um die Global Sache geht, dann füge mal in die erste Zeile der histogramm.php

Code: [Select]
$hist_image_id = $_GET['hist_image_id'];
ein.



... genau das behebt das Problem ... ;)
... in meinem Downloadpaket ist aber dieser Fix bereits enthalten ...
... also diese Zeile einfügen ... oder die histogramm.php nochmals downloaden ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline rubberduck

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • Reptilienmanager.de
Re: [MOD] Histogram
« Reply #117 on: January 27, 2008, 12:53:13 AM »
für php5 gerüstet.

Naja, hat ja nicht direkt mit PHP5 zu tun, eher mit den Core Einstellungen für register_globals.

Aber Hauptsache es funktioniert :)

ReptilienManager.de - Die Online Reptilien Verwaltung
Neueinsteiger.eu - Das Portal für Terraristik Einsteiger
Terra-ROW.de - Der regionale Terraristik Stammtisch in Rotenburg

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Histogram
« Reply #118 on: January 27, 2008, 01:46:20 AM »
@ Ivan
... schön das Histogramm bei dir wieder online zu sehen ... ;)
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Histogram
« Reply #119 on: March 10, 2008, 08:31:54 PM »
... was bedeutet ... "wenn keines (Bild) vorhanden ist" ...

- wenn kein Bild vorhanden ist, dann gibt es keine Detailseite auf der ein Histogramm gezeigt werden könnte ...
- wenn auf der Detailseite statt eines Bildes z.B. ein Video o.d.gl. gezeigt wird, so wird auch kein Histogramm gezeigt ...
- für welchen Dateityp die Erzeugung und Einblendung des Histogramms erfolgen soll, legst du über die Extensionen fest ...

... worin besteht das Problem ... ?
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...