Commit d6855b89 authored by André Anjos's avatar André Anjos

Merge branch 'netpbm-empty-lines' into 'master'

Fix readout of netpbm images containing empty lines (such as those produced by GIMP)

See merge request !43
parents 4c28740b 94fb56f2
Pipeline #29434 passed with stages
in 32 minutes and 11 seconds
......@@ -34,6 +34,25 @@
#define RGB_TYPE 1 /* used for PFM */
/* line_start
* Tells if a line should be ignored (completely empty or contains a comment)
* Returns: non-null if we should start reading from that position.
*/
static char* line_start (char* line) {
char* start = line;
int size = strnlen(line, MAXLINE);
for (int i = 0; i < size; ++i, ++start) {
if (isspace(*start)) continue;
if (isgraph(*start)) {
if ((*start) == '#') start = NULL;
break;
}
}
if (start == (line+size)) start = NULL; /* end-of-line ignore it */
return start;
}
/* get_pnm_type:
* Read the header contents of a PBM/PGM/PPM/PFM file up to the point of
* extracting its type. Valid types for a PNM image are as follows:
......@@ -51,26 +70,16 @@
*/
int get_pnm_type(FILE *f)
{
int flag=0;
int pnm_type=0;
unsigned int i;
char magic[MAXLINE];
char line[MAXLINE];
/* Read the PNM/PFM file header. */
while (fgets(line, MAXLINE, f) != NULL) {
flag = 0;
for (i = 0; i < strlen(line); i++) {
if (isgraph(line[i])) {
if ((line[i] == '#') && (flag == 0)) {
flag = 1;
}
}
}
if (flag == 0) {
sscanf(line, "%s", magic);
break;
}
char* start = line_start(line);
if (!start) continue; /* skip this line */
sscanf(line, "%s", magic);
break;
}
/* NOTE: This part can be written more succinctly, however,
......@@ -101,6 +110,7 @@ int get_pnm_type(FILE *f)
return (pnm_type);
}
/* read_pbm_header:
* Read the header contents of a PBM (Portable Binary Map) file.
* An ASCII PBM image file follows the format:
......@@ -114,35 +124,23 @@ int get_pnm_type(FILE *f)
*/
int read_pbm_header(FILE *f, int *img_xdim, int *img_ydim, int *is_ascii)
{
int flag=0;
int x_val, y_val;
unsigned int i;
char magic[MAXLINE];
char line[MAXLINE];
int count=0;
/* Read the PBM file header. */
while (fgets(line, MAXLINE, f) != NULL) {
flag = 0;
for (i = 0; i < strlen(line); i++) {
if (isgraph(line[i])) {
if ((line[i] == '#') && (flag == 0)) {
flag = 1;
}
}
}
if (flag == 0) {
if (count == 0) {
count += sscanf(line, "%s %d %d", magic, &x_val, &y_val);
} else if (count == 1) {
count += sscanf(line, "%d %d", &x_val, &y_val);
} else if (count == 2) {
count += sscanf(line, "%d", &y_val);
}
}
if (count == 3) {
break;
char* start = line_start(line);
if (!start) continue; /* skip this line */
if (count == 0) {
count += sscanf(start, "%s %d %d", magic, &x_val, &y_val);
} else if (count == 1) {
count += sscanf(start, "%d %d", &x_val, &y_val);
} else if (count == 2) {
count += sscanf(start, "%d", &y_val);
}
if (count == 3) break;
}
if (strcmp(magic, "P1") == 0) {
......@@ -176,37 +174,26 @@ int read_pbm_header(FILE *f, int *img_xdim, int *img_ydim, int *is_ascii)
*/
int read_pgm_header(FILE *f, int *img_xdim, int *img_ydim, int *img_colors, int *is_ascii)
{
int flag=0;
int x_val, y_val, maxcolors_val;
unsigned int i;
char magic[MAXLINE];
char line[MAXLINE];
int count=0;
/* Read the PGM file header. */
while (fgets(line, MAXLINE, f) != NULL) {
flag = 0;
for (i = 0; i < strlen(line); i++) {
if (isgraph(line[i]) && (flag == 0)) {
if ((line[i] == '#') && (flag == 0)) {
flag = 1;
}
}
}
if (flag == 0) {
if (count == 0) {
count += sscanf(line, "%s %d %d %d", magic, &x_val, &y_val, &maxcolors_val);
} else if (count == 1) {
count += sscanf(line, "%d %d %d", &x_val, &y_val, &maxcolors_val);
} else if (count == 2) {
count += sscanf(line, "%d %d", &y_val, &maxcolors_val);
} else if (count == 3) {
count += sscanf(line, "%d", &maxcolors_val);
}
}
if (count == 4) {
break;
char* start = line_start(line);
if (!start) continue; /* skip this line */
if (count == 0) {
count += sscanf(start, "%s %d %d %d", magic, &x_val, &y_val,
&maxcolors_val);
} else if (count == 1) {
count += sscanf(start, "%d %d %d", &x_val, &y_val, &maxcolors_val);
} else if (count == 2) {
count += sscanf(start, "%d %d", &y_val, &maxcolors_val);
} else if (count == 3) {
count += sscanf(start, "%d", &maxcolors_val);
}
if (count == 4) break;
}
if (strcmp(magic, "P2") == 0) {
......@@ -241,37 +228,26 @@ int read_pgm_header(FILE *f, int *img_xdim, int *img_ydim, int *img_colors, int
*/
int read_ppm_header(FILE *f, int *img_xdim, int *img_ydim, int *img_colors, int *is_ascii)
{
int flag=0;
int x_val, y_val, maxcolors_val;
unsigned int i;
char magic[MAXLINE];
char line[MAXLINE];
int count=0;
/* Read the PPM file header. */
while (fgets(line, MAXLINE, f) != NULL) {
flag = 0;
for (i = 0; i < strlen(line); i++) {
if (isgraph(line[i]) && (flag == 0)) {
if ((line[i] == '#') && (flag == 0)) {
flag = 1;
}
}
}
if (flag == 0) {
if (count == 0) {
count += sscanf(line, "%s %d %d %d", magic, &x_val, &y_val, &maxcolors_val);
} else if (count == 1) {
count += sscanf(line, "%d %d %d", &x_val, &y_val, &maxcolors_val);
} else if (count == 2) {
count += sscanf(line, "%d %d", &y_val, &maxcolors_val);
} else if (count == 3) {
count += sscanf(line, "%d", &maxcolors_val);
}
}
if (count == 4) {
break;
char* start = line_start(line);
if (!start) continue; /* skip this line */
if (count == 0) {
count += sscanf(start, "%s %d %d %d", magic, &x_val, &y_val,
&maxcolors_val);
} else if (count == 1) {
count += sscanf(start, "%d %d %d", &x_val, &y_val, &maxcolors_val);
} else if (count == 2) {
count += sscanf(start, "%d %d", &y_val, &maxcolors_val);
} else if (count == 3) {
count += sscanf(start, "%d", &maxcolors_val);
}
if (count == 4) break;
}
if (strcmp(magic, "P3") == 0) {
......@@ -433,7 +409,7 @@ int write_pbm_file(FILE *f, int *img_out,
fprintf(f, "%d %d\n", x_scaled_size, y_scaled_size);
/* Write the image data. */
for (i = 0; i < y_scaled_size; i++) {
for (i = 0; i < y_scaled_size; ++i) {
for (j = 0; j < x_scaled_size; j+=step) {
if (is_ascii == 1) {
fprintf(f, "%d ", img_out[i*x_scaled_size+j]);
......@@ -485,8 +461,8 @@ int write_pgm_file(FILE *f, int *img_out,
fprintf(f, "%d\n", img_colors);
/* Write the image data. */
for (i = 0; i < y_scaled_size; i++) {
for (j = 0; j < x_scaled_size; j++) {
for (i = 0; i < y_scaled_size; ++i) {
for (j = 0; j < x_scaled_size; ++j) {
if (is_ascii == 1) {
fprintf(f, "%d ", img_out[i*x_scaled_size+j]);
if (((i*x_scaled_size+j) % linevals) == (linevals-1)) {
......@@ -531,8 +507,8 @@ int write_ppm_file(FILE *f, int *img_out,
fprintf(f, "%d\n", img_colors);
/* Write the image data. */
for (i = 0; i < y_scaled_size; i++) {
for (j = 0; j < x_scaled_size; j++) {
for (i = 0; i < y_scaled_size; ++i) {
for (j = 0; j < x_scaled_size; ++j) {
if (is_ascii == 1) {
fprintf(f, "%d %d %d ",
img_out[3*(i*x_scaled_size+j)+0],
......
P5
# CREATOR: GIMP PNM Filter Version 1.1
100 100
255
[\[YXY\[^^]`]aaa`d_`ba_b`aad`ddagejhilpkjsuqnkqquypmstqrk{wrtxuxttvvww{{zxz{{w{|}}~XYYYZ[^_]\_[\^^]\baabb^bbfg`aggiii}ooitt}x~tq|xqlpozuptstzuu{uywxzyzxz}zz{{zz}|~X\Z]_[][\^__^^_`__a]f_ca_``\bee`dhwypp~kopzw~wpu|}vvwvwwvx|wy{{}y}|z~}}}~}~YZ[[\]][\]]\_]^```bc`_acbaaccbadwr{xrx~|uy~|zyqs|ux}{yyy~vuxux{wy}zz{z{}}}~WZ\\[[Z_aZ^]^_a^]]_``a_cbccdcbfn`mvw|ggdgo{yotuw{v{~xv{yxzy}x||{{z}~~~|~Z]]X^`^\^]`_``a_`a_^cbbbbhaeabhlninoTAE>;_]lok^gtmyvwzywxyz{zxwy~{|}y}~_[[[]]\```]]`a_]cbaa_`ccabdfbhlvxuqUA:9/36=CMRX_|wo~^`su{w~zzxz{|y{{||}}~~|~XZ[\_]]``a[]_^\__`Zdaa__eddbdabfxv\;6@ADB:2<D@J\d~nop}}}}}xyyxz|{}{|~~^\[Y\\Z\\^^^`^^^^^b^baacccegbfq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mlillkV[WXXZ]_[V[[[YZ^Y]\\__a=$# !3R{}yxzumnppnkmdiejfdë6inWeATgNBCOkjljjiknkojoonqmmkkoVXZZYWXTY[YZ\]^[Z\Z[bK,.<Wm}zwvwvswsmbhbjsvlgzįϪ+)Mg_>OYgFG?GdomjhjkimkhqllgmlolXZZWWV]ZXZ\ZZZ[[\aa`6(!"+;SdouxstqnyxonhjmoչF**J\2MXgOHADCMgmjikjjllmkmkjmmmWXW\XYZZYZ\\Z[\\[^G' "/:Qaqqnrtxw|zvsniiqs}~B'%-JT2AZZEJIBC>>HcijijhiigjkjlmjYWZV[ZZWZ[YX[\Z^T4!):VZgrkiov}}zokms~ϑ; (Ea/=NSL?BDC?A?DRdkmhmokkkkjilWYVWYZWYWXZY\`Z=&!+;:[]ormgou}}{w~</I]1@FER9=FA>:@B@JYljeikkkjhjiUWV]XZZ\ZYZ\_E'!!-=6TXlkmunqy~yz}y5! *>^7<?7N79=?>>;;;>BPjrmjiihkkjXWUW]XZZXX`B*""(:5MZgimoktqzۙd) !+C_6::7I16898:73:8;BHexrllnhieXVSZX[Y_YE' %#&2:LSbehoojmwx|wχQ! #,JT4645C-2857316/273<IcoipphjfWVXW[^]@.&  3G>W]addhmkjru{{{xP&"&.PV0730<+334210//03377?Xz`OdkkTWYXY4**! 7C<QXfe``gihokosv{rqxҷשcE.LT1.3.6.12//.+0.,.2/69;QgsdZkVY\>,.#  7D=LU[kb[hgcmncimpkho|vpɫ޸N>%#2XT,,,42,*/-(+,,),/-3128>PWhyaXT4(#!2ABMRTcd_[_hfommjd_]gt满ƠiA4"(6ZJ0*(-0+,(,0&)/))+*+++68?IUftP.*!  4AF>YR]fjcb_dkqt~zuxޭӮU<)!&7\D0),/0.*+')*+%+(()(')/08=KXd+" !(AG;JTYfmlfc_am~xmry}үκO9';Y<+(/070*+%')++)%'(((**05=AKZ"# !>DF@TY^gnmhjefjxww{}tK< ,?O6)$+..1'')*&)'(''&'$'&,/9;AK
......@@ -101,6 +101,7 @@ def test_netpbm():
transcode(test_utils.datafile('test.ppm', __name__)) # indexed, works fine
transcode(test_utils.datafile('test_2.pgm', __name__)) # indexed, works fine
transcode(test_utils.datafile('test_2.ppm', __name__)) # indexed, works fine
transcode(test_utils.datafile('test_spaces.pgm', __name__)) # indexed, works fine
# transcode(test_utils.datafile('test.jpg', __name__)) #does not work
# because of re-compression
......@@ -112,8 +113,8 @@ def notest_gif():
def test_image_load():
# test that the generic bob.io.image.load function works as expected
for filename in ('test.jpg', 'cmyk.jpg', 'test.pbm', 'test_corrupted.pbm',
'test.pgm', 'test_corrupted.pgm', 'test.ppm', 'test_corrupted.ppm',
'img_rgba_color.png', 'test.gif'):
'test.pgm', 'test_corrupted.pgm', 'test_spaces.pgm', 'test.ppm',
'test_corrupted.ppm', 'img_rgba_color.png', 'test.gif'):
full_file = test_utils.datafile(filename, __name__)
# load with just image name
i1 = bob.io.image.load(full_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment