#define COLOR_TEXT_SELECTED 64 136 211 255
#define COLOR_TEXT_DISABLED 87 87 87 128
#define COLOR_TEXT_BG 113 128 147 255
+#define COLOR_TEXT_ERR 218 51 51 255
#define COLOR_ITEM_BG 255 255 255 255
#define COLOR_ITEM_DEFAULT 119 169 202 255
#define COLOR_ITEM_FOCUS 0 119 246 255
/* part */
#define PART_VIEWER_BG "part.viewer_bg"
#define PART_VIEWER_CONTENT "part.viewer_content"
+#define PART_VIEWER_CONTENT_ERR "part.viewer_content_err"
#define PART_VIEWER_TITLE "part.viewer_title"
#define PART_VIEWER_DATE "part.viewer_date"
#define PART_VIEWER_PAGE "part.viewer_page"
static void _draw_contents(struct _priv *priv, int id, app_media_info *mi)
{
Evas_Object *obj;
+ Evas_Load_Error err;
+
+ elm_object_part_text_set(priv->base, PART_VIEWER_CONTENT_ERR, "");
if (id == VIEWER_MOVIE) {
_image_unload(priv);
_set_bg_color(priv, 0, 0, 0, 255);
- elm_photocam_file_set(obj, mi->file_path);
+ err = elm_photocam_file_set(obj, mi->file_path);
+ if (err != EVAS_LOAD_ERROR_NONE) {
+ _ERR("photocam file load failed (%d): %s", err, mi->file_path);
+
+ _image_unload(priv);
+
+ _set_bg_color(priv, 244, 244, 244, 255);
+ elm_object_part_text_set(priv->base, PART_VIEWER_CONTENT_ERR,
+ "Failed to load the image.");
+
+ return;
+ }
+
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
elm_photocam_image_orient_set(obj,
util_get_orient(mi->image->orientation));