mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
no extra tiff
This commit is contained in:
parent
48711e73ba
commit
bad2419c23
12
tiff.cc
12
tiff.cc
|
@ -1,10 +1,7 @@
|
|||
/* This file is (c) 2014 Abs62
|
||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||
|
||||
#ifdef MAKE_EXTRA_TIFF_HANDLER
|
||||
|
||||
#include "tiff.hh"
|
||||
|
||||
#ifdef MAKE_EXTRA_TIFF_HANDLER
|
||||
#if defined (Q_OS_WIN)
|
||||
#include "tiff/tiff.h"
|
||||
#include "tiff/tiffio.h"
|
||||
|
@ -12,6 +9,7 @@
|
|||
#include "tiff.h"
|
||||
#include "tiffio.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QApplication>
|
||||
|
@ -19,7 +17,7 @@
|
|||
|
||||
namespace GdTiff
|
||||
{
|
||||
|
||||
#ifdef MAKE_EXTRA_TIFF_HANDLER
|
||||
tsize_t tiffReadProc( thandle_t fd, tdata_t buf, tsize_t size )
|
||||
{
|
||||
return static_cast< QIODevice * >( fd )->read( static_cast< char * >( buf ), size );
|
||||
|
@ -140,7 +138,7 @@ bool tiffToQImage( const char * data, int size, QImage & image )
|
|||
TIFFClose( tiff );
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
void tiff2img( vector< char > & data, const char * format )
|
||||
{
|
||||
QImage img = QImage::fromData( (unsigned char *)&data.front(), data.size() );
|
||||
|
@ -169,4 +167,4 @@ void tiff2img( vector< char > & data, const char * format )
|
|||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
|
||||
|
|
7
tiff.hh
7
tiff.hh
|
@ -1,21 +1,20 @@
|
|||
#ifndef __TIFF_HH_INCLUDED__
|
||||
#define __TIFF_HH_INCLUDED__
|
||||
|
||||
#ifdef MAKE_EXTRA_TIFF_HANDLER
|
||||
|
||||
#include <QImage>
|
||||
#include <vector>
|
||||
using std::vector;
|
||||
namespace GdTiff
|
||||
{
|
||||
|
||||
#ifdef MAKE_EXTRA_TIFF_HANDLER
|
||||
// QImage don't handle TIFF files if TIFFTAG_PHOTOMETRIC is not set
|
||||
// We will handle such 1-bit b/w images with default photometric
|
||||
|
||||
bool tiffToQImage( const char * data, int size, QImage & image );
|
||||
#endif
|
||||
void tiff2img( vector< char > & data, const char * format = "webp" );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // TIFF_HH
|
||||
|
|
Loading…
Reference in a new issue