Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous.

RT 120154 - Exception when calling image_png with Path::Class::File-object

  • 2 Replies
  • 1240 Views
*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 353
    • View Profile
Thu Feb 09 05:41:32 2017 christoph.halbartschlager [...] atikon.com - Ticket created
Subject:    Exception when calling image_pdf with Path::Class::File-object
Date:    Thu, 09 Feb 2017 11:34:47 +0100
To:    bug-PDF-API2 [...] rt.cpan.org
From:    Christoph Halbartschlager <christoph.halbartschlager [...] atikon.com>

Hi

When calling image_png an exception is thrown if passed parameter is an object of type Path::Class::File.

Exception:

"Not a GLOB reference at /usr/lib/perl5/vendor_perl/5.18.2/PDF/API2/Resource/XObject/Image/PNG.pm line 35."

Cheers
Christoph

edit: subject line said "image_pdf" -- assuming meant "image_png"  -- Mod.
<formatting cleanup - Mod.>
« Last Edit: May 01, 2017, 10:42:42 AM by Phil »

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 353
    • View Profile
See also RT 117940. This may be similar, where the request was to allow more than just a filename as the argument (support already-opened filehandle). It should be handled in a consistent manner with all the other image_* calls, so it may mean adding code for object support (if that's possible) to a number of routines.

Depending on whether this is a missing capability in one or more image_* files, or a request for a new class of capability in all the image_* files, this bug might be moved to Feature Requests.
« Last Edit: February 09, 2017, 09:56:37 AM by Phil »

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 353
    • View Profile
Thu Jun 22 17:42:23 2017 steve [...] deefs.net - Correspondence added
Subject:    Exception when calling image_png with Path::Class::File-object

According to the docs, the image_png call takes either a filename or a filehandle.  Path::Class::File isn't either, but if you call the ->open() method on the object, it should work.

On Thu Feb 09 05:41:32 2017, christoph.halbartschlager@atikon.com wrote:
Quote
Hi
 
When calling image_png an exception is thrown if passed parameter is an object of type Path::Class::File.
 
Exception:
 
"Not a GLOB reference at /usr/lib/perl5/vendor_perl/5.18.2/PDF/API2/Resource/XObject/Image/PNG.pm line 35."
 
Cheers
Christoph
#
Thu Jun 22 17:42:24 2017 The RT System itself - Status changed from 'new' to 'open'
#
Thu Jun 22 17:42:29 2017 steve [...] deefs.net - Status changed from 'open' to 'rejected'