Skip Menu |
 

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 65665
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: perl [...] pied.nu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.80
Fixed in: 0.81



Subject: Imager::File::GIF are hidden from PAR
Download (untitled) / with headers
text/plain 823b
PAR uses Module::ScanDeps to find all dependencies and zip them up in a par file. M::SD uses crude static analysis to find these dependencies. Imager::File::GIF, ::JPEG, ::PNG are automagically loaded only when needed. However, the following bit of code, when added to Imager.pm, will make the sub-modules visible to Module::ScanDeps. They are each wrapped in eval {} because we don't care if they can be loaded or not. if( $INC{ 'Module/ScanDeps.pm' } ) { eval { require Imager::File::GIF }; eval { require Imager::File::JPEG }; eval { require Imager::File::PNG }; eval { require Imager::File::SGI }; eval { require Imager::File::TIFF }; } Confirm with: scandeps.pl Imager.pm Note that scandeps.pl does static analysis. So the $INC{'Module/ScanDeps.pm'} should (nearly) always be false.
Download (untitled) / with headers
text/plain 509b
On Fri Feb 11 20:32:14 2011, GWYN wrote: Show quoted text
> PAR uses Module::ScanDeps to find all dependencies and zip them up in a > par file. M::SD uses crude static analysis to find these dependencies. > Imager::File::GIF, ::JPEG, ::PNG are automagically loaded only when
needed. How does PAR behave if the modules returned by Module::ScanDeps don't exist? eg. Imager::Font::W32 on anything non-windows or Imager::Font::T1 (0.81) on most systems Will it try to include it and fail when the module can't be found? Tony
Download (untitled) / with headers
text/plain 863b
On Fri Feb 11 20:32:14 2011, GWYN wrote: Show quoted text
> PAR uses Module::ScanDeps to find all dependencies and zip them up in a > par file. M::SD uses crude static analysis to find these dependencies. > Imager::File::GIF, ::JPEG, ::PNG are automagically loaded only when
needed. Show quoted text
> > However, the following bit of code, when added to Imager.pm, will make > the sub-modules visible to Module::ScanDeps. They are each wrapped in > eval {} because we don't care if they can be loaded or not. > > if( $INC{ 'Module/ScanDeps.pm' } ) { > eval { require Imager::File::GIF }; > eval { require Imager::File::JPEG }; > eval { require Imager::File::PNG }; > eval { require Imager::File::SGI }; > eval { require Imager::File::TIFF }; > }
I've included the eval{}s in the new preload method, which should produce the same effect. Released in Imager 0.81. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.