if (_handle->path)
err = mm_util_decode_from_jpeg_file_with_downscale(_handle->path, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG), _convert_decode_scale_tbl[_handle->down_scale], jpeg_data);
else
- err = mm_util_decode_from_jpeg_memory_with_downscale(_handle->src_buffer[0], (unsigned int)_handle->src_size, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG), _convert_decode_scale_tbl[_handle->down_scale], jpeg_data);
+ err = mm_util_decode_from_jpeg_memory_with_downscale(_handle->src_buffer[0], (size_t)_handle->src_size, TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG), _convert_decode_scale_tbl[_handle->down_scale], jpeg_data);
if (err == MM_UTIL_ERROR_NONE) {
*(_handle->dst_buffer) = jpeg_data->data;
if (_handle->path)
err = mm_util_decode_from_png_file(_handle->path, png_data);
else
- err = mm_util_decode_from_png_memory(_handle->src_buffer[0], _handle->src_size, png_data);
+ err = mm_util_decode_from_png_memory(_handle->src_buffer[0], (size_t)_handle->src_size, png_data);
if (err == MM_UTIL_ERROR_NONE) {
*(_handle->dst_buffer) = png_data->data;
- _handle->dst_size = png_data->size;
+ _handle->dst_size = (unsigned long long)png_data->size;
_handle->width = png_data->width;
_handle->height = png_data->height;
}
if (_handle->path)
err = mm_util_decode_from_bmp_file(_handle->path, bmp_data);
else
- err = mm_util_decode_from_bmp_memory(_handle->src_buffer[0], _handle->src_size, bmp_data);
+ err = mm_util_decode_from_bmp_memory(_handle->src_buffer[0], (size_t)_handle->src_size, bmp_data);
if (err == MM_UTIL_ERROR_NONE) {
*(_handle->dst_buffer) = bmp_data->data;
- _handle->dst_size = bmp_data->size;
+ _handle->dst_size = (unsigned long long)bmp_data->size;
_handle->width = bmp_data->width;
_handle->height = bmp_data->height;
}
mm_util_jpeg_yuv_data decoded;
memset(&decoded, 0, sizeof(mm_util_jpeg_yuv_data));
- err = mm_util_decode_from_jpeg_memory_with_downscale((void *)jpeg_buffer, (unsigned int)jpeg_size, TYPECAST_COLOR_BY_TYPE(colorspace, IMAGE_UTIL_JPEG), _convert_decode_scale_tbl[downscale], &decoded);
+ err = mm_util_decode_from_jpeg_memory_with_downscale((void *)jpeg_buffer, (size_t)jpeg_size, TYPECAST_COLOR_BY_TYPE(colorspace, IMAGE_UTIL_JPEG), _convert_decode_scale_tbl[downscale], &decoded);
if (err == MM_UTIL_ERROR_NONE) {
*image_buffer = decoded.data;
case IMAGE_UTIL_JPEG:
{
mm_util_jpeg_yuv_data *jpeg_data = (mm_util_jpeg_yuv_data *) _handle->image_h;
- unsigned int size = 0;
+ size_t size = 0;
jpeg_data->data = _handle->src_buffer[0];
jpeg_data->format = TYPECAST_COLOR_BY_TYPE(_handle->colorspace, IMAGE_UTIL_JPEG);
size_t size = 0;
bmp_data->data = _handle->src_buffer[0];
- if (_handle->path) {
+
+ if (_handle->path)
err = mm_util_encode_bmp_to_file(bmp_data, _handle->path);
- } else {
+ else
err = mm_util_encode_bmp_to_memory(bmp_data, _handle->dst_buffer, &size);
- if (err == MM_UTIL_ERROR_NONE)
- bmp_data->size = (unsigned long long)size;
- else
- bmp_data->size = 0;
- }
+
if (err == MM_UTIL_ERROR_NONE)
_handle->dst_size = (unsigned long long)size;
}