#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    0

    Reading .jpg metadata in C


    Hello

    I am translating a MATLAB code into C and these are the lines:
    file_name = imageTest(i,: );
    imgInfo = imfinfo(file_name);
    *IMAGE_1 = imread(file_name);
    *if strcmp(imgInfo.ColorType,'truecolor')
    ******IMAGE_1 = rgb2gray(IMAGE_1);
    *end

    and imageTest is a two dimensional array with the list of jpg files like below:

    imageTest = ['InputImages/imageTest_00590.jpg'; 'InputImages/imageTest_00591.jpg'; 'InputImages/imageTest_00592.jpg'; 'InputImages/imageTest_00593.jpg'; 'InputImages/imageTest_00594.jpg';************ 'InputImages/imageTest_00595.jpg'; 'InputImages/imageTest_00596.jpg'; 'InputImages/imageTest_00597.jpg'; 'InputImages/imageTest_00598.jpg'; 'InputImages/imageTest_00599.jpg'];

    how I can change this code to C? I did search but I did not find anything related.

    I would appreciate it if sb can help me in this.

    Thanks
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,417
    Rep Power
    1871
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo