펄로 이미지를 좀 다뤄볼까 하는데 에러에 막혀 영 진도를 못 나가서 질문 좀 드립니다.
글쓴이: uook / 작성시간: 월, 2009/11/23 - 6:33오후
개발 내공이 그득한 놈이 아니다보니 구글링을 한참을 해봐도 모르겠어서 이렇게 질문 올립니다.
여러 문서를 찾아봤지만 대체적으로 http://mojomojo.org/troubleshooting#Q:_When_I_run_make_test.2C_I_get_an_error_about_jpeg_not_supported:
와 같은 정도로만 설명이 되어 있어서요
일단 libjpeg가 설치되어 있는지 확인해 봤습니다.
perl에서 사용할 Imager 모듈 설치도 확인했습니다.
http://search.cpan.org/~addi/Imager-0.41/Imager.pm 에 나와있는 sample 코드(thumbmak.pl)를 가지고
jpg 파일을 실행해 봤더니 아래와 같이 오류가 떨어지는데,
어딜 손봐야 할지 좀 알려주세요.
$ yum list installed | grep "libjp" libjpeg.i386 6b-37 installed cpan[1]> install Imager CPAN: Storable loaded ok (v2.21) Going to read '/root/.cpan/Metadata' Database was generated on Sun, 22 Nov 2009 06:27:04 GMT Imager is up to date (0.71). $ cat thumbmake.pl #!/usr/bin/perl -w # Thumbnail example # <a href="http://search.cpan.org/~addi/Imager-0.41/Imager.pm use" rel="nofollow">http://search.cpan.org/~addi/Imager-0.41/Imager.pm use</a> strict; use Imager; die "Usage: thumbmake.pl filename\n" if !-f $ARGV[0]; my $file = shift; my $format; my $img = Imager->new(); $img->open(file=>$file) or die $img->errstr(); $file =~ s/\.[^.]*$//; # Create smaller version my $thumb = $img->scale(scalefactor=>.3); # Autostretch individual channels $thumb->filter(type=>'autolevels'); # try to save in one of these formats SAVE: for $format ( qw( png gif jpg tiff ppm ) ) { # Check if given format is supported if ($Imager::formats{$format}) { $file.="_low.$format"; print "Storing image as: $file\n"; $thumb->write(file=>$file) or die $thumb->errstr; last SAVE; } } $ perl thumbmake.pl 090831042134_887006618_b.jpg format 'jpeg' not supported - formats bmp, ico, pnm, raw, sgi, tga available for reading at thumbmake.pl line 13. http://search.cpan.org/~addi/Imager-0.41/Imager.pm
Forums:
Imager 모듈 설치가 힘드시면
모듈 설치가 힘드시면
http://j2k.naver.com/j2k_frame.php/korean/it.kndb.jp/entry/show/id/2572
을 참고해보시고 그래도 안되면 perl-Imager rpm 패키지를 설치하고 해보세요.
http://fr2.rpmfind.net/linux/rpm2html/search.php?query=perl-imager&submit=Search+...
[bushi@rose gralloc]$ yum
OTL
댓글 달기