Opened 3 years ago

Closed 2 years ago

#2577 closed Bug (fixed)

Call to undefined function imagecreatefrompng when generating PDF

Reported by: matt Owned by:
Priority: normal Milestone: 1.7 Piwik 1.7
Component: Core Keywords:
Cc: Sensitive: no

Description

See report in http://forum.piwik.org/read.php?2,79483

When generating PDF reports, if GD is not installed, the error is returned. Instead, we should show to the user a proper error message that suggests to install GD.

If this happens in the cron, we can make sure that the error returned as part of #2440

Change History (9)

comment:2 Changed 3 years ago by vipsoft (robocoder)

tcpdf/tcpdf.php already has checks in some places for function_exists( some_gd_function ). This can probably be fixed upstream.

comment:3 Changed 3 years ago by vipsoft (robocoder)

We already have an installation system check for gd, and warn when it's not present.

comment:4 Changed 3 years ago by matt (mattab)

  • Milestone changed from 1.7 Piwik 1.7 to 1.6 Piwik 1.6

comment:5 Changed 3 years ago by matt (mattab)

  • Resolution set to worksforme
  • Status changed from new to closed

I disabled GD but pdf reports still worked.. works for me

comment:6 Changed 3 years ago by vipsoft (robocoder)

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Matt, I think you still have the 'imagick' extension. Looking at the code path, 'gd is the fallback if the 'imagick' extension isn't available.

comment:7 Changed 3 years ago by vipsoft (robocoder)

Can we defer to 1.7 and update libs/tcpdf at the same time?

comment:8 Changed 3 years ago by matt (mattab)

  • Milestone changed from 1.6 Piwik 1.6 to 1.7 Piwik 1.7

comment:9 Changed 2 years ago by matt (mattab)

  • Milestone changed from 1.8 Piwik 1.8 to 1.7 Piwik 1.7
  • Resolution set to fixed
  • Status changed from reopened to closed

It works now, graphs are not displayed when no GD (but icons still display in the report which is nice)

Note: See TracTickets for help on using tickets.