static void _resize_movie(struct _emotion_plugin *_plugin) { Ethumb *e = _plugin->e; double ratio; int w, h; int fx, fy, fw, fh; ratio = emotion_object_ratio_get(_plugin->video); ethumb_calculate_aspect_from_ratio(e, ratio, &w, &h); ethumb_calculate_fill_from_ratio(e, ratio, &fx, &fy, &fw, &fh); DBG("size: w=%d, h=%d fill: x=%d, y=%d, w=%d, h=%d", w, h, fx, fy, fw, fh); _plugin->w = w; _plugin->h = h; ethumb_plugin_image_resize(e, _plugin->w, _plugin->h); if (_plugin->edje_frame) { evas_object_resize(_plugin->edje_frame, fw, fh); evas_object_move(_plugin->edje_frame, fx, fy); } else { evas_object_resize(_plugin->video, fw, fh); evas_object_move(_plugin->video, fx, fy); } emotion_object_audio_mute_set(_plugin->video, 1); }
static void _generate_thumb(Ethumb *e) { Epdf_Document *document; Epdf_Page *page; Evas_Object *o; const char *src_path; int w, h, ww, hh; int fx, fy, fw, fh; unsigned int npages, pagenum; ethumb_file_get(e, &src_path, NULL); document = epdf_document_new(src_path); if (!document) { fprintf(stderr, "ERROR: could not read document: %s\n", src_path); ethumb_finished_callback_call(e, 0); return; } page = epdf_page_new(document); if (!page) { fprintf(stderr, "ERROR: could not read document: %s\n", src_path); epdf_document_delete(document); ethumb_finished_callback_call(e, 0); return; } npages = epdf_document_page_count_get(document); pagenum = ethumb_document_page_get(e); if (pagenum < npages) epdf_page_page_set(page, pagenum); epdf_page_size_get(page, &w, &h); ethumb_calculate_aspect(e, w, h, &ww, &hh); ethumb_plugin_image_resize(e, ww, hh); o = evas_object_image_add(ethumb_evas_get(e)); epdf_page_render(page, o); evas_object_resize(o, ww, hh); evas_object_move(o, 0, 0); ethumb_calculate_fill(e, w, h, &fx, &fy, &fw, &fh); evas_object_image_fill_set(o, fx, fy, fw, fh); evas_object_show(o); ethumb_image_save(e); evas_object_del(o); epdf_page_delete(page); epdf_document_delete(document); ethumb_finished_callback_call(e, 1); }