• [MOD] Histogram 4 0 5 1
Currently:  

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

0 Members and 2 Guests are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [req mod] histogram
« Reply #30 on: March 04, 2006, 12:45:02 AM »
@mawenzi:
Try save all the files into one independent folder and name each file with image id.
For example if an image has ID 12568 the saved chache histogram image would have name 12568.png
I think that is the easiest way to do and no need to wory about creating additional folders for each category, etc ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [req mod] histogram
« Reply #31 on: March 04, 2006, 02:47:16 PM »
so, after all small problems are solved (or there are still others ... ?) could now a MOD from it are made ...  :D
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 Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [req mod] histogram
« Reply #32 on: March 04, 2006, 04:05:28 PM »
yipeee... I'm waiting...  :D

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [req mod] histogram
« Reply #33 on: March 05, 2006, 10:11:13 PM »
thanks a lot mawenzi :!: :!: :!:

kann mich nur anschliessen!

and a thx for vano (background)

http://hobby-fotografen.com/img1908.htm

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [req mod] histogram
« Reply #34 on: March 07, 2006, 07:57:17 PM »
@ V@no,

... and once again ... the most unusual histogram ...  :wink: ...
... I knew, there is still coming something ...

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: [req mod] histogram
« Reply #35 on: March 11, 2006, 05:12:56 PM »
I have make a Backgroundimage for the histogram.

Das ist schlichtweg falsch !
Du hast das Bild von meiner Seite kopiert und mit einer anderen Hintergrundfarbe versehen. Denn wenn du es erstellt hättest, dann wüstest du auch etwas mit den Koordinaten dazu anzufangen. Ich habe nichts dagegen, dass dieses Hintergrundbild zum Histogramm verwendet wird. Ich habe aber etwas dagegen, wenn jemand behauptet er hätte es erstellt obwohl er es definitiv nicht gemacht hat !
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: [req mod] histogram
« Reply #36 on: March 11, 2006, 06:07:45 PM »
Ich habe oben bereits gesagt, dass ich nichts dagegen habe wenn das Bild verwendet wird.
Ich habe aber etwas gegen deine lächerlichen Ausführungen der Rechtfertigung. Du hast keine Ahnung von der Systematik der Koordinaten, warum das Hauptraster vom Unterraster versetzt ist, warum das Raster so beschriftet ist, welcher Schrifttyp da verwendet wird, angeblich warum das Bild incl. der Beschriftung deckungsgleich mit dem von mir erstellten Vorladebild ist (Du hast Schriftzeilen mit PS entfernt ... . Mein Histogramm-Bild wird komplett incl. Raster vom Script erstellt ... ohne Hintergrund.), geschweige denn wie die Histogramm-Linien in das Koordinatensytem passend integriert werden ... und schreibst dann so einen Müll ! Und sehe dir mal die letzten Beiträge an, die Wörter ... geklaut ... Dieb ... erscheinen nur bei dir !

kehre mal in dich ... mawenzi
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: [req mod] histogram
« Reply #37 on: March 11, 2006, 06:56:37 PM »
genau das richtige Bild gefunden ... und wenn du dann noch richtig gelesen hättest ... es ist das Vorladebild ... dazu muss man aber wissen wie das Script läuft . Und ich sage es nochmals ( zum 3.mal ? ) : ich habe nichts dagegen wenn das Bild verwendet wird !
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 Chicco

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • The Picture World
Re: [MOD] Histogram
« Reply #38 on: March 20, 2006, 11:56:04 PM »
Frage zum Mod nochmal, nachdem ich nun doch wieder auch eingebaut habe.
Vielleicht habe ich es nun auf den drei Seiten übersehen, und einer hat schon mal diesbezüglich gefragt, aber wie sieht es aus, wenn ich ein Foto als Admin lösche? Das davon erstellte Histogramm bleibt bestehen, gelle? :?


Wissen ist MACHT! Nix zu wissen macht aber auch nix! ;-)

Gruß
Ch¿cco

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Histogram
« Reply #39 on: March 21, 2006, 12:20:38 AM »
... Das davon erstellte Histogramm bleibt bestehen, gelle? :?

... Ja .
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 Chicco

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • The Picture World
Re: [MOD-REQ] Histogram
« Reply #40 on: March 21, 2006, 12:25:59 AM »
hmmm...

Ist es dann möglich so was im Admin-Panel bei der Funktion Löschen von Bildern , das entsprechende histogramm zu löschen? sowas wie histo+{image_name} oder sowas.... Sonst hat man ja eines Tages unheimlich viele tote Bilder quasi auf seinem Server herumliegen oder muss immer mühevoll per FTP das entsprechende Bild separat löschen....

Dachte ja schon an die Lösung mit evtl. "Neue Bilder checken", aber das reagiert nicht auf die HISTO-Dateien....


Wissen ist MACHT! Nix zu wissen macht aber auch nix! ;-)

Gruß
Ch¿cco

Offline cappuccino

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • PIXXGALLERY
Re: [MOD-REQ] Histogram
« Reply #41 on: March 25, 2006, 06:37:52 PM »
Hallo,
habe nun auch versucht, dieses Script in 1.7.2 einzubinden.
Leider passiert hier irgendwie überhaupt nichts.

Lege ich in den Ordner 11 eine hist_PICT0011.png Datei, dann wird diese auch nicht angezeigt. Nur ein durchgestrichenes Bild mit dieser URL:
http://eiber.dyndns.biz/histo.php?hist_image=PICT0011.JPG&hist_file=hist_PICT0011.png&hist_path=data/media/11/

Die codes habe ich so eingefügt:

histo.php:
Code: [Select]
<?php
//      Histogram creation
//      Created by Anton Sparrius (Spaz) 6/9/05  anton_spaz@yahoo.com
//      Free to use and change, provided you keep these lines :)
//
                        if (file_exists($hist_path.$hist_file)) {
                          $im=imagecreatefromPNG($hist_path $hist_file);
                          imagePNG($im);
                          imagedestroy($im);
                        } else {
                        $im=imagecreatefromjpeg($hist_path.$hist_image);
                        for($i=0;$i<imagesx($im);$i+=2)
                        {
                                for($j=0;$j<imagesy($im);$j++)
                                {
                                        $rrggbb=imagecolorsforindex ($imimagecolorat($im,$i,$j));
                                        $r[$rrggbb['red']]+=1;
                                        $g[$rrggbb['green']]+=1;
                                        $b[$rrggbb['blue']]+=1;
                                }
                        }
                        for ($i=0;$i<256;$i++)
                        {
                                $max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
                        }
                        $max_value=max($max)/150;
                        $m[0]=max($r);
                        $m[1]=max($b);
                        $m[2]=max($g);
                        $max_rgb=max($m)/150;

                        $im_out imageCreate (280164);
                        $background imageColorAllocate($im_out,70,70,70);
                        $hist=ImageColorAllocate($im_out,171,205,239);
                        $white=ImageColorAllocate($im_out,255,255,255);
                        $red=ImageColorAllocate($im_out,255,0,0);
                        $green=ImageColorAllocate($im_out,0,255,0);
                        $blue=ImageColorAllocate($im_out,0,0,255);
                        $ry=107;
                        $gy=107;
                        $by=107;

                        for($i=0;$i<256;$i++)
                        {
                                imageLine($im_out$i+14157$i+14157-($max[$i]/$max_value),$white);
                                imageLine($im_out$i+13$ry$i+14157-($r[$i]/$max_rgb), $red);
                                imageLine($im_out$i+13$gy$i+14157-($g[$i]/$max_rgb), $green);
                                imageLine($im_out$i+13$by$i+14157-($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);

                        imagePNG($im_out,$hist_path $hist_file);
                        imageDestroy($im);
                        imagedestroy($im_out);
                        $im=imagecreatefromPNG($hist_path $hist_file);
                        imagePNG($im);
                        imagedestroy($im);
                        }
?>


details.php
Code: [Select]
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
//--- Start Histogramm 27.02.2006 ----------------------

$hist_image = $image_row['image_media_file'];
$hist_file= "hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path = "data/media/".$cat_id."/";

$ext = substr($hist_image, strpos($hist_image, ".")+1, strlen($hist_image));
$AutorisedImageType = array ("jpg", "jpeg", "JPG", "JPEG");  // Dateitypen für die das Histogramm gezeigt werden soll

if (in_array($ext, $AutorisedImageType)) {
   $histogramm_image = "<img src='histo.php?hist_image=".$hist_image."&hist_file=".$hist_file."&hist_path=".$hist_path."' border=\"1\">";
} else {
   $histogramm_image = REPLACE_EMPTY;
}

$site_template->register_vars(array(
   "histogramm" => "Histogramm:",
   "histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------

details.html
Code: [Select]
{if histogramm_image}
<tr>
<td valign="top" class="row1"><b>{histogramm}</b></td>
<td valign="top" class="row1">{histogramm_image}</td>
</tr>
{endif histogramm_image}

Die anderen codes sind von Seite1 übernommen worden
Irgendwie wird bei mir keine Datei erstellt und auch keine angezeigt
Hier noch der Testlink der Seite: http://eiber.dyndns.biz/details.php?image_id=55

Kann mir jemand von Euch bei diesem Problem weiterhelfen?
Danke im Voraus

Gruß

Offline 051276

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD-REQ] Histogram
« Reply #42 on: March 25, 2006, 06:47:40 PM »
Halli Hallo,
geht mir ganz genau wie Dir.
Ich habe nun schon 5 mal hintereinander alles ein- und wieder ausgebaut, aber immer erscheint kein Histogram. Immer nur das durchgestriche Symbol.
Siehe hier http://mikeonline.name/gallery/details.php?image_id=6
Vielleicht hat ja jemand ne Idee an was es liegt.

Offline cappuccino

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • PIXXGALLERY
Re: [MOD-REQ] Histogram
« Reply #43 on: March 25, 2006, 06:52:36 PM »
ruft man bei dir auch die Seite auf http://mikeonline.name/gallery/histo.php?hist_image=DSC_0060.jpg&hist_file=hist_DSC_0060.png&hist_path=data/media/3/ kommen genauso diese Script Fehlermeldungen wie bei mir

Code: [Select]
Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/web21/html/mike/gallery/histo.php on line 12

Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 27

Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 28

Warning: Wrong parameter count for max() in /var/www/web21/html/mike/gallery/histo.php on line 29

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 46

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 47

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 48

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 49

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 50

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 51

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 46

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 47

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 48

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 49

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 50

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 51

Warning: Division by zero in /var/www/web21/html/mike/gallery/histo.php on line 45

usw........



gruß

Offline Chicco

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • The Picture World
Re: [MOD-REQ] Histogram
« Reply #44 on: March 26, 2006, 02:07:58 PM »
 :? Hmmm....

Also ihr habt euch genau an die Anleitung von Mawenzi gehalten, oder?

Auch Step 3.1 und 3.2?

Übrigens: Wieso kann ich mir dein Verzeichis auflisten lassen? Sind deine Schreib.- und Leserechte richtig gesetzt?
Wenn ich http://eiber.dyndns.biz/data/media/11/ eingebe im Browser, zeigt er mir den Inhalt dieses Verzeichnisses an. Sollte ja nicht sein, oder? :roll:
Vielleicht liegt es an den Schreib und Leserechte?

Ansonsten kann ich auch keinen Fehler momentan nachvollziehen...das histo.php ist richtig. Habe es mir dem hier vergliechen sowie mit meinem. Alles gleich bis auf das, das ich ein Hintergundbild verwende. Aber das sollte nicht der Fehler bei euch sein.

Ich denke mal, das der einzige, welcher euch dabei helfen kann, der Mawenzi ist.....


Wissen ist MACHT! Nix zu wissen macht aber auch nix! ;-)

Gruß
Ch¿cco