Oh dear! There is actually something "off the shelf that is going to give you the functionality that your are looking for": zbar
#!/bin/bash
for file in $*
do
name="`zbarimg -q $file`"
echo "Renaming $file to $name"
mv $file $name
done
Put that into a file. rename_barcode.sh
for instance. And:
chmod u+x rename_barcode.sh
./rename_barcode.sh *.jpg *.png
Of course, it is a bit rough over the edges (what if no barcode is found?), but zbarimg
gives you the functionality you want. The remaining part is really just scripting.
EDIT:
Sorry, you didn't mention Linux. The aforementioned script is a bash script assuming that the zbar
package is installed. If you are using Windows, you just have to install zbarimg.exe somewhere and create a similar script but using MS Batch syntax.
I probably wouldn't do this with Photoshop. – Ignacio Vazquez-Abrams – 2013-01-26T16:34:31.457
What encoding do the barcodes use? – Ignacio Vazquez-Abrams – 2013-01-26T16:35:14.937
2you say, "the photos would be taken in a special lightbox" is there a reason the barcode can't be scanned WHEN taking the photo into the save dialog? – datatoo – 2013-01-26T17:31:40.223
>
If the part ID is in the picture, couldn't you have a bot parse the image for the ID? – Kruug – 2013-01-29T20:22:06.433
Use barcode font ... it may ID be too ... – STTR – 2013-01-29T22:22:50.013