forked from enlightenment/efl
parent
bb17dcb661
commit
1f5e929fd1
|
@ -316,6 +316,11 @@ data_write(void)
|
||||||
ecore_init();
|
ecore_init();
|
||||||
ecore_evas_init();
|
ecore_evas_init();
|
||||||
ee = ecore_evas_buffer_new(1, 1);
|
ee = ecore_evas_buffer_new(1, 1);
|
||||||
|
if (!ee)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create buffer engine canvas for image load.\n");
|
||||||
|
ABORT_WRITE(ef, file_out);
|
||||||
|
}
|
||||||
evas = ecore_evas_get(ee);
|
evas = ecore_evas_get(ee);
|
||||||
for (l = edje_file->image_dir->entries; l; l = l->next)
|
for (l = edje_file->image_dir->entries; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
@ -424,7 +429,7 @@ data_write(void)
|
||||||
0, qual, 1);
|
0, qual, 1);
|
||||||
if (bytes <= 0)
|
if (bytes <= 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s \n",
|
fprintf(stderr, "%s: Error. unable to write image part \"%s\" as \"%s\" part entry to %s\n",
|
||||||
progname, img->entry, buf, file_out);
|
progname, img->entry, buf, file_out);
|
||||||
ABORT_WRITE(ef, file_out);
|
ABORT_WRITE(ef, file_out);
|
||||||
}
|
}
|
||||||
|
@ -436,7 +441,7 @@ data_write(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. unable to load image for image part \"%s\" as \"%s\" part entry to %s \n",
|
fprintf(stderr, "%s: Error. unable to load image for image part \"%s\" as \"%s\" part entry to %s\n",
|
||||||
progname, img->entry, buf, file_out);
|
progname, img->entry, buf, file_out);
|
||||||
ABORT_WRITE(ef, file_out);
|
ABORT_WRITE(ef, file_out);
|
||||||
}
|
}
|
||||||
|
@ -460,7 +465,7 @@ data_write(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: Error. unable to load image for image \"%s\" part entry to %s \n",
|
fprintf(stderr, "%s: Error. unable to load image for image \"%s\" part entry to %s. Missing PNG ot JPEG loader modules for Evas or file does not exist, or is not readable.\n",
|
||||||
progname, img->entry, file_out);
|
progname, img->entry, file_out);
|
||||||
ABORT_WRITE(ef, file_out);
|
ABORT_WRITE(ef, file_out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,8 +151,18 @@ output(void)
|
||||||
ecore_init();
|
ecore_init();
|
||||||
ecore_evas_init();
|
ecore_evas_init();
|
||||||
ee = ecore_evas_buffer_new(1, 1);
|
ee = ecore_evas_buffer_new(1, 1);
|
||||||
|
if (!ee)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create buffer engine canvas for image save.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
evas = ecore_evas_get(ee);
|
evas = ecore_evas_get(ee);
|
||||||
im = evas_object_image_add(evas);
|
im = evas_object_image_add(evas);
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create image object for save.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
snprintf(buf, sizeof(buf), "images/%i", ei->id);
|
snprintf(buf, sizeof(buf), "images/%i", ei->id);
|
||||||
evas_object_image_file_set(im, file_in, buf);
|
evas_object_image_file_set(im, file_in, buf);
|
||||||
snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
|
snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
|
||||||
|
@ -163,11 +173,15 @@ output(void)
|
||||||
if (strstr(pp, "../"))
|
if (strstr(pp, "../"))
|
||||||
{
|
{
|
||||||
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
|
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
|
||||||
exit (-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
e_file_mkpath(pp);
|
e_file_mkpath(pp);
|
||||||
free(pp);
|
free(pp);
|
||||||
evas_object_image_save(im, out, NULL, "quality=100 compress=9");
|
if (!evas_object_image_save(im, out, NULL, "quality=100 compress=9"))
|
||||||
|
{
|
||||||
|
printf("ERROR: cannot write file %s. Perhaps missing JPEG or PNG saver modules for Evas.\n", out);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
evas_object_del(im);
|
evas_object_del(im);
|
||||||
ecore_evas_free(ee);
|
ecore_evas_free(ee);
|
||||||
ecore_evas_shutdown();
|
ecore_evas_shutdown();
|
||||||
|
|
|
@ -31,9 +31,19 @@ main(int argc, char **argv)
|
||||||
args_parse();
|
args_parse();
|
||||||
|
|
||||||
ee = ecore_evas_buffer_new(outw, outh);
|
ee = ecore_evas_buffer_new(outw, outh);
|
||||||
|
if (!ee)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create buffer engine canvas for image save.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
evas = ecore_evas_get(ee);
|
evas = ecore_evas_get(ee);
|
||||||
|
|
||||||
im = ecore_evas_object_image_new(ee);
|
im = ecore_evas_object_image_new(ee);
|
||||||
|
if (!im)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create buffer canvas image object for scaling.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
evas_object_move(im, 0, 0);
|
evas_object_move(im, 0, 0);
|
||||||
evas_object_resize(im, outw, outh);
|
evas_object_resize(im, outw, outh);
|
||||||
evas_object_image_fill_set(im, 0, 0, outw, outh);
|
evas_object_image_fill_set(im, 0, 0, outw, outh);
|
||||||
|
@ -43,6 +53,11 @@ main(int argc, char **argv)
|
||||||
evas_im = ecore_evas_get(ee_im);
|
evas_im = ecore_evas_get(ee_im);
|
||||||
|
|
||||||
im2 = ecore_evas_object_image_new(ee_im);
|
im2 = ecore_evas_object_image_new(ee_im);
|
||||||
|
if (!im2)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error. cannot create buffer canvas image for scaling.\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
evas_object_move(im2, 0, 0);
|
evas_object_move(im2, 0, 0);
|
||||||
evas_object_resize(im2, outw, outh);
|
evas_object_resize(im2, outw, outh);
|
||||||
evas_object_image_fill_set(im2, 0, 0, outw, outh);
|
evas_object_image_fill_set(im2, 0, 0, outw, outh);
|
||||||
|
@ -194,7 +209,11 @@ frame_grab(void *data)
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), outfile, frnum);
|
snprintf(buf, sizeof(buf), outfile, frnum);
|
||||||
ecore_evas_buffer_pixels_get(ee);
|
ecore_evas_buffer_pixels_get(ee);
|
||||||
evas_object_image_save(im, buf, NULL, "quality=100 compress=9");
|
if (!evas_object_image_save(im, buf, NULL, "quality=100 compress=9"))
|
||||||
|
{
|
||||||
|
printf("Cannot load file \"%s\". Missing saver moduel for Evas or literally cannto write the file (permissions or directory doesnt exist).\n", buf);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
frnum++;
|
frnum++;
|
||||||
if (frnum == frames)
|
if (frnum == frames)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue