Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need script to convert jpg images to img format?

    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!

  • #2
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Is this the file format you're referring to?

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •