Review Request 116532: Add imagedump: a utility to dump the raw data of a QImage

David Faure faure at kde.org
Sun Mar 2 16:04:47 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116532/#review51671
-----------------------------------------------------------

Ship it!



tests/imagedump.cpp
<https://git.reviewboard.kde.org/r/116532/#comment36772>

    This whole string<->enum mapping can be done better with a static const struct[] array and a (linear or binary) search through it for stringToFormat, and in this case a direct [format] indexing for formatToString.
    This generates less code, and leads to less duplication (the data is in a single place).
    
    But of course this is just a test program, so I'm only saying this for information, not veto-ing the code :)
    



tests/imagedump.cpp
<https://git.reviewboard.kde.org/r/116532/#comment36774>

    and this would just iterate over the array and print all strings ;)


- David Faure


On March 2, 2014, 11:41 a.m., Alex Merry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116532/
> -----------------------------------------------------------
> 
> (Updated March 2, 2014, 11:41 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kimageformats
> 
> 
> Description
> -------
> 
> Add imagedump: a utility to dump the raw data of a QImage
> 
> This is intended as an aid when writing and debugging imageformat
> plugins.  It creates a file containing the bytes of QImage::bits(),
> which can then be viewed in Okteta.
> 
> 
> Diffs
> -----
> 
>   tests/CMakeLists.txt 81d903a9c7480acf662421f4429f5f60c146441a 
>   tests/imagedump.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/116532/diff/
> 
> 
> Testing
> -------
> 
> Builds.
> 
> Tested commands:
> imagedump -h (prints help)
> imagedump -p (prints expected list of QImage::Format options)
> imagedump -l (prints expected list of QImageReader formats)
> imagedump something.xcf something.data (dumps data in ARGB32 format)
> imagedump something.png something.data (dumps data in ARGB32 format)
> imagedump -q RGB32 something.xcf something.data (dumps data in RGB32 format)
> 
> All data dumps sanity-checked in Okteta.
> 
> 
> Thanks,
> 
> Alex Merry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140302/f49f83a5/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list