mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
plugin/jpg: Fixed to load large images
This commit is contained in:
parent
e23589ece9
commit
a0e21df6cc
5 changed files with 33 additions and 16 deletions
13
autotest/LargeJpeg/LargeJpeg.cpp
Normal file
13
autotest/LargeJpeg/LargeJpeg.cpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include <Core/Core.h>
|
||||
#include <plugin/jpg/jpg.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Image m = StreamRaster::LoadFileAny(GetDataFile("sample.jpg"));
|
||||
DDUMP(m.GetSize());
|
||||
ASSERT(m.GetSize() == Size(1920, 1080));
|
||||
|
||||
// if this does not work, set #define DEFAULT_MAX_MEM 100000000L
|
||||
}
|
||||
10
autotest/LargeJpeg/LargeJpeg.upp
Normal file
10
autotest/LargeJpeg/LargeJpeg.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
Core,
|
||||
plugin/jpg;
|
||||
|
||||
file
|
||||
LargeJpeg.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
BIN
autotest/LargeJpeg/sample.jpg
Normal file
BIN
autotest/LargeJpeg/sample.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 548 KiB |
|
|
@ -16,7 +16,7 @@ const char *GetENUS(const char *id);
|
|||
// has to be included from file that is not part of package...
|
||||
#include "t_.h"
|
||||
|
||||
/* t_.h:
|
||||
/* t_.h content:
|
||||
#ifdef t_
|
||||
#undef t_
|
||||
#endif
|
||||
|
|
@ -25,21 +25,13 @@ const char *GetENUS(const char *id);
|
|||
#undef tt_
|
||||
#endif
|
||||
|
||||
#define t_(x) t_GetLngString(x)
|
||||
#define tt_(x) x
|
||||
*/
|
||||
#ifndef t_h
|
||||
#define t_h
|
||||
|
||||
inline const char *t_(const char *s) { return t_GetLngString(s); }
|
||||
inline const char *tt_(const char *s) { return s; }
|
||||
|
||||
/* lt_.h:
|
||||
#ifdef t_
|
||||
#undef t_
|
||||
#endif
|
||||
|
||||
#ifdef tt_
|
||||
#undef tt_
|
||||
#endif
|
||||
|
||||
#define t_(x) x
|
||||
#define tt_(x) x
|
||||
*/
|
||||
|
||||
String GetLngString(const char *id); // Only works with string literals because of caching !
|
||||
|
|
|
|||
|
|
@ -73,10 +73,12 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
|
|||
* a slop factor of 5% or so.
|
||||
*/
|
||||
|
||||
#ifndef DEFAULT_MAX_MEM /* so can override from makefile */
|
||||
#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */
|
||||
#ifdef DEFAULT_MAX_MEM /* so can override from makefile */
|
||||
#undef DEFAULT_MAX_MEM
|
||||
#endif
|
||||
|
||||
#define DEFAULT_MAX_MEM 100000000L //U++: Let us have this fixed at 100MB...
|
||||
|
||||
GLOBAL(long)
|
||||
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
|
||||
long max_bytes_needed, long already_allocated)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue