/* * libmedia-thumbnail * * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: Hyunjun Ko * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include #include #include "media-thumbnail.h" #include "media-thumb-util.h" #ifndef _MEDIA_THUMB_INTERNAL_H_ #define _MEDIA_THUMB_INTERNAL_H_ #define THUMB_WIDTH_MAX /* The maximum of resolution to be able to get thumbnail is 3000 x 3000, except for only jpeg */ #define THUMB_MAX_ALLOWED_MEM_FOR_THUMB 9000000 #define THUMB_LARGE_WIDTH 320 #define THUMB_LARGE_HEIGHT 240 #define THUMB_SMALL_WIDTH 160 #define THUMB_SMALL_HEIGHT 120 typedef struct { int size; int width; int height; int origin_width; int origin_height; int alpha; unsigned char *data; bool is_saved; } media_thumb_info; enum Exif_Orientation { NOT_AVAILABLE=0, NORMAL =1, HFLIP =2, ROT_180 =3, VFLIP =4, TRANSPOSE =5, ROT_90 =6, TRANSVERSE =7, ROT_270 =8 }; typedef struct { ThumbFunc func; void *user_data; } thumbUserData; typedef struct { ThumbRawFunc func; void *user_data; } thumbRawUserData; int _media_thumb_image(const char *origin_path, const char *thumb_path, int thumb_width, int thumb_height, media_thumb_format format, media_thumb_info *thumb_info, bool is_req_raw); int _media_thumb_video(const char *origin_path, int thumb_width, int thumb_height, media_thumb_format format, media_thumb_info *thumb_info); int _media_thumb_get_hash_name(const char *file_full_path, char *thumb_hash_path, size_t max_thumb_path, uid_t uid); int _media_thumb_save_to_file_with_evas(unsigned char *data, int w, int h, int alpha, char *thumb_path); #endif /*_MEDIA_THUMB_INTERNAL_H_*/