An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.It worked fine on my old Fedora Core system so I hit the web to find the answer. It only took a few minutes, and some help from Google, to find the answer. It appears to be a bug.
Here's the link to fix it.
https://launchpad.net/ubuntu/+source/libgphoto2/+bug/91250
You can read the whole thing but here's the crux of it.
Edit /etc/udev/rules.d/45-libgphoto2.rules
replace
BUS!="usb*", GOTO="libgphoto2_rules_end"
with
SUBSYSTEM!
#!/usr/bin/perl
## this perl script converts jpgs to smaller jpgs and set the maximum size.
$size = '640';
@files= `ls *.jpg`;
foreach $file(@files) {
chomp $file;
print "Infile is $file\n";
($outfile,$ext) = split(/\./,$file);
$outfile .= '_sm.jpg';
print "Outfile is $outfile\n";
$cmd = "convert -geometry $size $file $outfile";
print "$cmd\n";
system $cmd;
}
Here's another version that changes the formate from jpg to png. Note, you only need to change the filename extension to make this happen.
#!/usr/bin/perl
## this perl script converts jpgs to png and set the maximum size.
$size = '640';
@files= `ls *.jpg`;
foreach $file(@files) {
chomp $file;
print "Infile is $file\n";
($outfile,$ext) = split(/\./,$file);
$outfile .= '.png';
print "Outfile is $outfile\n";
$cmd = "convert -geometry $size $file $outfile";
print "$cmd\n";
system $cmd;
}
For more information about Image Magick, visit their site at http://www.imagemagick.org
No comments:
Post a Comment