Fix native image capture code and DALi image saving 63/129063/2
authorNick Holland <nick.holland@partner.samsung.com>
Fri, 12 May 2017 14:58:02 +0000 (15:58 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Wed, 17 May 2017 14:25:09 +0000 (14:25 +0000)
commit58c658a302b20d6c2d6510e2e2aee7953ae2bf5c
treeb8eb2b93f3d96ea37c27073ea143eb648b3941ea
parentc1729c28474125c3b86fca5830ffc8e754827ad9
Fix native image capture code and DALi image saving

1.
When trying to save an Image using
NativeImageSource::EncodeToFile( )
it was found that the JPEG and PNG code for saving a file had a bug
resulting in zero byte files being created.

Cause of the problem was due to code using Vector::Reserve
then a memcpy to copy image data into a vector. The vector
was then passed to function to save. As Vector::Reserve
doesn't adjust the size of the vector, Vector::Count()
was returning zero, so zero bytes were being written.

2.
When converting pixel data from TBM_FORMAT_RGB888 and
TBM_FORMAT_RGBA8888 to Dali::Pixel::RGB888 and Pixel::RGB8888
the Red component of a pixel was never being set
 ( except with an incorrect value for the first pixel of every line).

This resulted in captured images being green/blue.

Cherry picked from Tizen_3.0 branch where the patch has been tested
https://review.tizen.org/gerrit/#/c/129061/

Change-Id: Ie24d50a5f25449a78623a9b91eb68a52843a179b
adaptors/tizen/native-image-source-impl-tizen.cpp
platform-abstractions/tizen/image-loaders/loader-jpeg-turbo.cpp
platform-abstractions/tizen/image-loaders/loader-png.cpp