You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was really confused when I had problem with putting together Path::Tiny with I::S, so here is little testcase, which demos the problem:
#!/usr/bin/env perl
use strict; use warnings; use 5.018;
use Path::Tiny;
use Image::Scale;
my $jpeg_path = path( $ARGV[0] )
or die "JPEG mandatory\n";
my $png_path = path( 'img.png' );
warn "we have path $png_path!\n";
my $img = Image::Scale->new( $jpeg_path );
$img->resize_gd( { width => '100', keep_aspect => 1 } );
$img->save_png( $png_path );
It gives me output:
we have path img.png!
Image::Scale->save_jpeg requires a path at simple_image_scale_example.pl line 16.
If I use some stringification, it will work, like:
$img->save_png( "$png_path" );
As the save_png seems to reside inside XS-code, it appears that automatic stringification of Path::Tiny object does not work here. Or is it quite a Path::Tiny's issue?
Thanks for the report. The reason this error occurs is probably because those XS methods are expecting a char * when it should really be an SV (or have a pure-Perl wrapper method). I'll get this fixed soon.
Hi!
I was really confused when I had problem with putting together Path::Tiny with I::S, so here is little testcase, which demos the problem:
It gives me output:
If I use some stringification, it will work, like:
As the save_png seems to reside inside XS-code, it appears that automatic stringification of Path::Tiny object does not work here. Or is it quite a Path::Tiny's issue?
Also, I noticed a typo on line 249 in xs-file:
https://github.com/andygrundman/Image-Scale/blob/master/Scale.xs#L249
There
croak
should saysave_png
instead ofsave_jpeg
.The text was updated successfully, but these errors were encountered: