diff --git a/autotest/LargeJpeg/LargeJpeg.cpp b/autotest/LargeJpeg/LargeJpeg.cpp new file mode 100644 index 000000000..a5c996247 --- /dev/null +++ b/autotest/LargeJpeg/LargeJpeg.cpp @@ -0,0 +1,13 @@ +#include +#include + +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 +} diff --git a/autotest/LargeJpeg/LargeJpeg.upp b/autotest/LargeJpeg/LargeJpeg.upp new file mode 100644 index 000000000..250fceda7 --- /dev/null +++ b/autotest/LargeJpeg/LargeJpeg.upp @@ -0,0 +1,10 @@ +uses + Core, + plugin/jpg; + +file + LargeJpeg.cpp; + +mainconfig + "" = ""; + diff --git a/autotest/LargeJpeg/sample.jpg b/autotest/LargeJpeg/sample.jpg new file mode 100644 index 000000000..d9a5c67ff Binary files /dev/null and b/autotest/LargeJpeg/sample.jpg differ diff --git a/uppsrc/Core/i18n.h b/uppsrc/Core/i18n.h index b6194fe74..0a9344e83 100644 --- a/uppsrc/Core/i18n.h +++ b/uppsrc/Core/i18n.h @@ -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 ! diff --git a/uppsrc/plugin/jpg/lib/jmemansi.c b/uppsrc/plugin/jpg/lib/jmemansi.c index b5da4743f..1156e5e02 100644 --- a/uppsrc/plugin/jpg/lib/jmemansi.c +++ b/uppsrc/plugin/jpg/lib/jmemansi.c @@ -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)