...

View Full Version : Need script to convert jpg images to img format?



timster
03-20-2009, 05:01 AM
Need script to convert jpg images to img format. Using absurd Italian software that requires it. Thought the following would work but does not. Any ideas?

[CODE]
file = 'C:\my documents\my pictures';
extension = '*.jpg';
chemin = fullfile(file,extension);
list = dir(chemin);

for n = 1:numel(list)

info = imfinfo(fullfile(file,list(n).name),extension(end-2:end));
Nom = info.Filename;
img = imread(fullfile(file,list(n).name),extension(end-2:end));

hold on
figure;
imshow(img);
img2 = [Nom(1:end-4) '.img'];
imwrite(img,img2);
hold off

end
[CODE]

THANKS!

BoldUlysses
03-20-2009, 02:29 PM
Is this the file format you're referring to (http://en.wikipedia.org/wiki/IMG_(file_format))?

Also, it would be helpful if you told us what language your script is in.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum