Problem with Images

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
stein85
Posts: 3
Joined: Tue Apr 24, 2012 7:19 am

Problem with Images

#1 Post by stein85 » Wed Jul 20, 2016 7:06 am

Hello,

i have installed the version 0.98 and the generated images are not shown correct.
2016-07-20 13_43_00.png
2016-07-20 13_43_00.png (4.36 KiB) Viewed 981 times
So i click on view image. I get the error message "The image [url] cannot be displayed because it contains errors."
2016-07-20 13_46_32.png
2016-07-20 13_46_32.png (35.5 KiB) Viewed 981 times
I have checked the following problems.

Image generation
Looks fine.

Code: Select all

php weathermap-cacti-rebuild.php
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] Weathermap 0.98 starting - Normal logging mode. Turn on DEBUG in Cacti for more information

07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 7] test.conf: Map: ..../plugins/weathermap/configs/test.conf -> ..../plugins/weathermap/output/cf704995ea0c3ce90435.html & ..../plugins/weathermap/output/cf704995ea0c3ce90435.jpg
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 7] test.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 7] test.conf: Wrote map to ..../plugins/weathermap/output/cf704995ea0c3ce90435.jpg and ..../plugins/weathermap/output/cf704995ea0c3ce90435.thumb.jpg
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 5] simple.conf: Map: ..../plugins/weathermap/configs/simple.conf -> ..../plugins/weathermap/output/27709dc959d7ba94ccc1.html & ..../plugins/weathermap/output/27709dc959d7ba94ccc1.jpg
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 5] simple.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] [Map 5] simple.conf: Wrote map to ..../plugins/weathermap/output/27709dc959d7ba94ccc1.jpg and ..../plugins/weathermap/output/27709dc959d7ba94ccc1.thumb.jpg
07/20/2016 01:48:08 PM - WEATHERMAP: Poller[0] STATS: Weathermap 0.98 run complete - Wed, 20 Jul 16 13:48:08 +0200: 2 maps were run in 0 seconds with 0 warnings.
Image direct access
Looks fine.
2016-07-20 13_56_39.png
2016-07-20 13_56_39.png (393.4 KiB) Viewed 981 times
Reduce the code

Code: Select all

<?php
	header('Content-type: image/png');
	readfile('..../plugins/weathermap/output/27709dc959d7ba94ccc1.png');
?>
Looks fine.
2016-07-20 14_02_11.png
2016-07-20 14_02_11.png (382.52 KiB) Viewed 981 times
Actual I do not know what I could check to solve the problem.
In the editor I have the same problem.
2016-07-20 14_10_47.png
2016-07-20 14_10_47.png (16.75 KiB) Viewed 981 times
check.php and check-gdbug.php

Code: Select all

php check.php
----------------------------------------------------
Weathermap Pre-Install Checker
...

PHP Basics
----------
This is PHP Version 5.6.7-1 running on "Linux Debian x86_64" with a memory_limit of
'-1'.

The php.ini file was /etc/php5/cli/php.ini
The following additional ini files were read: /etc/php5/cli/conf.d/05-opcache.ini,
/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-gd.ini,
/etc/php5/cli/conf.d/20-json.ini,
/etc/php5/cli/conf.d/20-mcrypt.ini,
/etc/php5/cli/conf.d/20-mysql.ini,
/etc/php5/cli/conf.d/20-mysqli.ini,
/etc/php5/cli/conf.d/20-pdo_mysql.ini,
/etc/php5/cli/conf.d/20-readline.ini


PHP Functions
-------------
Some parts of Weathermap need special support in your PHP
installation to work.

This PHP uses the system GD library, which MIGHT have alpha-blending bugs.
Check that you have at least GD 2.0.34 installed, if you see problems with
weathermap segfaulting.
You can test for this specific fault by running check-gdbug.php

The Console_Getopt PEAR module is available. That's good!

            imagepng   YES
imagecreatetruecolor   YES
  imagealphablending   YES
      imageSaveAlpha   YES
          preg_match   YES
  imagecreatefrompng   YES
 imagecreatefromjpeg   YES
  imagecreatefromgif   YES
           imagejpeg   YES
            imagegif   YES
  imagecopyresampled   YES
        imagettfbbox   YES
    memory_get_usage   YES

---------------------------------------------------------------------
OK! Your PHP and server environment *seems* to have support for ALL of the
Weathermap features. Make sure you have run this script BOTH as a web page
and from the CLI to be sure, however.
</table>
</body>
</html>

Code: Select all

php check-gdbug.php
Some version of the GD graphics library have a bug in their handling of
Alpha channels. Unfortunately, Weathermap uses these to draw Nodes.

This program will test if your PHP installation is using a buggy GD
library.

If you are, you should either use PHP's built-in (aka 'bundled') GD
library, or update to GD Version 2.0.34 or newer. Weathermap REQUIRES
working Alpha support.

Let's see if you have the GD transparency bug...

If you see no more output, or a segfault, then you do, and you'll need to
upgrade.

If you get other errors, like 'undefined function', then run check.php to
make sure that your PHP installation is otherwise OK.

Here we go...

...nope. We got past the risky part, so that's good.
Your GD library looks healthy.

stein85
Posts: 3
Joined: Tue Apr 24, 2012 7:19 am

Re: Problem with Images

#2 Post by stein85 » Fri Jul 22, 2016 8:20 am

Problem is solved.
I checked the cacti code because I did some changes in it, but it don't helps.

After this I checked all plugins because, every setup.php file is included at the page request.

Here I found the error.
2016-07-22 13_14_49.png
2016-07-22 13_14_49.png (865 Bytes) Viewed 956 times
Some of my own plugins had a error, I changed it to :
2016-07-22 13_15_10.png
2016-07-22 13_15_10.png (723 Bytes) Viewed 956 times
Now everything is working.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Problem with Images

#3 Post by Howie » Fri Jul 22, 2016 10:03 am

Which Debian release is that? I'm inclined to think it's something with your installation, since there are no other reports of similar issues, but I'd be interested to test.

Also, is it with Cacti from source or packages?
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

Post Reply