Mohammad Moghimi
Mohammad Moghimi

Reputation: 4686

imread from string instead of file?

Is it possible to read encoded image content from a string instead of a file in MATLAB?

Something like this:

data_string = '����JFIF``���C......'    
imread(data_string);

Upvotes: 0

Views: 522

Answers (1)

Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

As a work-around, write the string into a file:

 fid = fopen('temp.jpg','wt');
 fprintf(fid, data_string);
 fclose(fid);

And then read:

 im = imread('temp.jpg');

Upvotes: 2

Related Questions