[Digikam-devel] extragear/graphics/digikam/libs/dimg/loaders

Gilles Caulier caulier.gilles at gmail.com
Fri Nov 21 07:04:04 GMT 2008


2008/11/21 Patrick Spendrin <ps_ml at gmx.de>

> SVN commit 887048 by sengels:
>
> fix digikam crashes when trying to open png files under MSVC
> I will close the following bug - we need a more precise bug report now.
> BUG:173918
> @digikam-devels:
> It should be possible to remove the ifdef's and use this solution under
> Linux too. That way maintenance would be easier for me and you. Ideas?


I'm totally agree. It will be more simple to maintains.

Gilles


>
> CCMAIL:digikam-devel at kde.org <CCMAIL%3Adigikam-devel at kde.org>
>
>  M  +12 -0     pngloader.cpp
>
>
> --- trunk/extragear/graphics/digikam/libs/dimg/loaders/pngloader.cpp
> #887047:887048
> @@ -59,6 +59,14 @@
>  #include "dimg.h"
>  #include "dimgloaderobserver.h"
>
> +#ifdef Q_CC_MSVC
> +void _ReadProc(struct png_struct_def *png_ptr, unsigned char *data,
> unsigned int size)
> +{
> +    FILE* file_handle = (FILE*)png_get_io_ptr(png_ptr);
> +    fread(data, size, 1, file_handle);
> +}
> +#endif
> +
>  namespace Digikam
>  {
>
> @@ -134,7 +142,11 @@
>         return false;
>     }
>
> +#ifdef Q_CC_MSVC
> +    png_set_read_fn(png_ptr, f, _ReadProc);
> +#else
>     png_init_io(png_ptr, f);
> +#endif
>
>     // -------------------------------------------------------------------
>     // Read all PNG info up to image data
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20081121/a5492a8a/attachment.html>


More information about the Digikam-devel mailing list