IMAGE_UTIL_SAFE_FREE(image);
}
-static int __mm_util_create_color_image(mm_image_info_s **image, unsigned long width, unsigned long height, mm_util_color_format_e color, void *data, size_t size)
+static int __mm_util_create_color_image(mm_image_info_s **image, unsigned int width, unsigned int height, mm_util_color_format_e color, void *data, size_t size)
{
int ret = IMAGE_UTIL_ERROR_NONE;
mm_image_info_s *_color_image = NULL;
_color_image->height = height;
_color_image->color = color;
- image_util_debug("w [%lu], h [%lu], color [%u], size [%zu], data [%p]", _color_image->width, _color_image->height, _color_image->color, _color_image->size, _color_image->data);
+ image_util_debug("w [%u], h [%u], color [%u], size [%zu], data [%p]", _color_image->width, _color_image->height, _color_image->color, _color_image->size, _color_image->data);
*image = _color_image;
}
if (dst_buf[dst_index] != NULL && res_buffer_size != 0) {
- ret = __mm_util_create_color_image(&(handle->dst), (unsigned long)src_width, (unsigned long)src_height, src_format, (void *)dst_buf[dst_index], res_buffer_size);
+ ret = __mm_util_create_color_image(&(handle->dst), src_width, src_height, src_format, (void *)dst_buf[dst_index], res_buffer_size);
if (ret != IMAGE_UTIL_ERROR_NONE)
image_util_error("__mm_util_create_color_image failed");
} else {
{
int err = IMAGE_UTIL_ERROR_NONE;
mm_util_color_format_e format = 0;
- unsigned long width = 0, height = 0;
+ unsigned int width = 0, height = 0;
void *buffer = NULL;
size_t buffer_size = 0;
media_format_h fmt = NULL;
handle->src = pop_data;
handle->dst = NULL;
- image_util_debug("orig_image: %p [%zu] %lu X %lu (%u)", pop_data->data, pop_data->size, pop_data->width, pop_data->height, pop_data->color);
+ image_util_debug("orig_image: %p [%zu] %u X %u (%u)", pop_data->data, pop_data->size, pop_data->width, pop_data->height, pop_data->color);
ret = __mm_util_transform(handle);
if (handle->dst != NULL)
- image_util_debug("result_image: %p [%zu] %lu X %lu (%u)", handle->dst->data, handle->dst->size, handle->dst->width, handle->dst->height, handle->dst->color);
+ image_util_debug("result_image: %p [%zu] %u X %u (%u)", handle->dst->data, handle->dst->size, handle->dst->width, handle->dst->height, handle->dst->color);
else
image_util_error("Error - handle->dst is NULL");
image_util_debug("[Fotmat: %u] W x H : %d x %d", mimetype, width, height);
image_util_retvm_if(((width == 0) || (height == 0) || (size == 0) || (ptr == NULL)), IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid source packet");
- err = __mm_util_create_color_image(color_image, (unsigned long)width, (unsigned long)height, __mimetype_to_image_format(mimetype), ptr, (size_t)size);
+ err = __mm_util_create_color_image(color_image, (unsigned int)width, (unsigned int)height, __mimetype_to_image_format(mimetype), ptr, (size_t)size);
image_util_retvm_if((err != IMAGE_UTIL_ERROR_NONE), err, "__mm_util_create_color_image failed (%d)", err);
image_util_debug("_image_util_packet_to_image succeed");
return IMAGE_UTIL_ERROR_NONE;
}
-static int _image_util_decode_internal(decode_s * _handle, unsigned long *res_width, unsigned long *res_height, size_t *res_size)
+static int __image_util_decode_internal(decode_s * _handle, unsigned int *res_width, unsigned int *res_height, size_t *res_size)
{
int err = MM_UTIL_ERROR_NONE;
image_util_fenter();
if (_handle->path)
err = mm_util_decode_from_png_file(_handle->path, &image_info);
else
- err = mm_util_decode_from_png_memory(_handle->src_buffer, (size_t)_handle->src_size, &image_info);
+ err = mm_util_decode_from_png_memory(_handle->src_buffer, _handle->src_size, &image_info);
}
break;
case IMAGE_UTIL_GIF:
if (_handle->path)
err = mm_util_decode_from_gif_file(_handle->path, &image_info);
else
- err = mm_util_decode_from_gif_memory(_handle->src_buffer, (size_t)_handle->src_size, &image_info);
+ err = mm_util_decode_from_gif_memory(_handle->src_buffer, _handle->src_size, &image_info);
}
break;
case IMAGE_UTIL_BMP:
if (_handle->path)
err = mm_util_decode_from_bmp_file(_handle->path, &image_info);
else
- err = mm_util_decode_from_bmp_memory(_handle->src_buffer, (size_t)_handle->src_size, &image_info);
+ err = mm_util_decode_from_bmp_memory(_handle->src_buffer, _handle->src_size, &image_info);
}
break;
default:
image_util_error("fail to decode image [%d]", err);
}
- image_util_debug("dst_buffer(%p) width (%lu) height (%lu) dst_size (%zu)", *(_handle->dst_buffer), *res_width, *res_height, *res_size);
+ image_util_debug("dst_buffer(%p) width (%u) height (%u) dst_size (%zu)", *(_handle->dst_buffer), *res_width, *res_height, *res_size);
return _image_error_capi(err);
}
{
int err = IMAGE_UTIL_ERROR_NONE;
decode_s *_handle = (decode_s *) handle;
- unsigned long _width = 0;
- unsigned long _height = 0;
+ unsigned int _width = 0;
+ unsigned int _height = 0;
size_t _size = 0;
image_util_retvm_if(_handle == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle");
image_util_retvm_if(width == NULL || height == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid width or height");
image_util_retvm_if(size == NULL, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid size");
- err = _image_util_decode_internal(_handle, &_width, &_height, &_size);
+ err = __image_util_decode_internal(_handle, &_width, &_height, &_size);
image_util_retvm_if(err != IMAGE_UTIL_ERROR_NONE, err, "_image_util_decode_internal failed");
- *width = _width;
- *height = _height;
+ *width = (unsigned long)_width;
+ *height = (unsigned long)_height;
*size = (unsigned long long)_size;
return err;
{
decode_s *_handle = (decode_s *) data;
int err = IMAGE_UTIL_ERROR_NONE;
- unsigned long _width = 0;
- unsigned long _height = 0;
+ unsigned int _width = 0;
+ unsigned int _height = 0;
size_t _size = 0;
image_util_fenter();
image_util_retvm_if((_handle == NULL), NULL, "Invalid Handle");
- err = _image_util_decode_internal(_handle, &_width, &_height, &_size);
+ err = __image_util_decode_internal(_handle, &_width, &_height, &_size);
if (err == IMAGE_UTIL_ERROR_NONE)
image_util_debug("Success - decode_internal");
else
if (_handle->_decode_cb) {
image_util_debug("call completed_cb");
- _handle->_decode_cb->image_decode_completed_cb(err, _handle->_decode_cb->user_data, _width, _height, (unsigned long long)_size);
+ _handle->_decode_cb->image_decode_completed_cb(err, _handle->_decode_cb->user_data, (unsigned long)_width, (unsigned long)_height, (unsigned long long)_size);
} else {
image_util_error("No callback");
}