[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31935] trunk/blender: bugfix [#23405] PNG Images bigger then 2gig wont load with blender.
Campbell Barton
ideasman42 at gmail.com
Wed Sep 15 08:43:37 CEST 2010
Revision: 31935
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31935
Author: campbellbarton
Date: 2010-09-15 08:43:36 +0200 (Wed, 15 Sep 2010)
Log Message:
-----------
bugfix [#23405] PNG Images bigger then 2gig wont load with blender.
all image formats should be able to load files bigger then 2gig (when its supported)
Modified Paths:
--------------
trunk/blender/extern/libopenjpeg/CMakeLists.txt
trunk/blender/source/blender/blenkernel/intern/effect.c
trunk/blender/source/blender/blenkernel/intern/exotic.c
trunk/blender/source/blender/blenkernel/intern/fluidsim.c
trunk/blender/source/blender/blenkernel/intern/particle_system.c
trunk/blender/source/blender/blenlib/BLI_storage.h
trunk/blender/source/blender/blenlib/intern/bpath.c
trunk/blender/source/blender/blenlib/intern/storage.c
trunk/blender/source/blender/blenloader/intern/readblenentry.c
trunk/blender/source/blender/imbuf/IMB_imbuf.h
trunk/blender/source/blender/imbuf/intern/IMB_filetype.h
trunk/blender/source/blender/imbuf/intern/allocimbuf.c
trunk/blender/source/blender/imbuf/intern/bmp.c
trunk/blender/source/blender/imbuf/intern/filetype.c
trunk/blender/source/blender/imbuf/intern/iris.c
trunk/blender/source/blender/imbuf/intern/jp2.c
trunk/blender/source/blender/imbuf/intern/jpeg.c
trunk/blender/source/blender/imbuf/intern/module.c
trunk/blender/source/blender/imbuf/intern/png.c
trunk/blender/source/blender/imbuf/intern/radiance_hdr.c
trunk/blender/source/blender/imbuf/intern/readimage.c
trunk/blender/source/blender/imbuf/intern/targa.c
trunk/blender/source/blender/imbuf/intern/tiff.c
trunk/blender/source/blender/readblenfile/intern/BLO_readblenfile.c
Modified: trunk/blender/extern/libopenjpeg/CMakeLists.txt
===================================================================
--- trunk/blender/extern/libopenjpeg/CMakeLists.txt 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/extern/libopenjpeg/CMakeLists.txt 2010-09-15 06:43:36 UTC (rev 31935)
@@ -24,9 +24,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(INC . src)
+SET(INC .)
-FILE(GLOB SRC *.c except t1_generate_luts.c)
-ADD_DEFINITIONS(-DWITH_OPENJPEG)
+FILE(GLOB SRC *.c)
BLENDERLIB(extern_openjpeg "${SRC}" "${INC}")
-#, libtype=['international','player'], priority=[5, 210])
Modified: trunk/blender/source/blender/blenkernel/intern/effect.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/effect.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenkernel/intern/effect.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -29,6 +29,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stddef.h>
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <math.h>
Modified: trunk/blender/source/blender/blenkernel/intern/exotic.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/exotic.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenkernel/intern/exotic.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -29,12 +29,14 @@
*
* ***** END GPL LICENSE BLOCK *****/
+#include <stddef.h>
#include "BLI_storage.h"
+#include <stdlib.h>
#include <ctype.h> /* isdigit, isspace */
#include <math.h>
#include <stdio.h>
-#include <stdlib.h>
+
#include <fcntl.h>
#include <string.h>
#include <errno.h>
Modified: trunk/blender/source/blender/blenkernel/intern/fluidsim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/fluidsim.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenkernel/intern/fluidsim.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -28,6 +28,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stddef.h>
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include "MEM_guardedalloc.h"
Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -29,6 +29,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stddef.h>
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <stdlib.h>
Modified: trunk/blender/source/blender/blenlib/BLI_storage.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_storage.h 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenlib/BLI_storage.h 2010-09-15 06:43:36 UTC (rev 31935)
@@ -42,12 +42,13 @@
struct direntry;
+
void BLI_adddirstrings(void);
void BLI_builddir(char *dirname, char *relname);
int BLI_compare(struct direntry *entry1, struct direntry *entry2);
-int BLI_filesize(int file);
-int BLI_filepathsize(const char *path);
+size_t BLI_filesize(int file);
+size_t BLI_filepathsize(const char *path);
double BLI_diskfree(char *dir);
char *BLI_getwdN(char *dir);
Modified: trunk/blender/source/blender/blenlib/intern/bpath.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/bpath.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenlib/intern/bpath.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -633,7 +633,7 @@
if (S_ISREG(status.st_mode)) { /* is file */
if (strncmp(filename, de->d_name, FILE_MAX)==0) { /* name matches */
/* open the file to read its size */
- size = BLI_filepathsize(path);
+ size = status.st_size;
if ((size > 0) && (size > *filesize)) { /* find the biggest file */
*filesize = size;
BLI_strncpy(filename_new, path, FILE_MAX);
Modified: trunk/blender/source/blender/blenlib/intern/storage.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/storage.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenlib/intern/storage.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -421,7 +421,7 @@
}
-int BLI_filesize(int file)
+size_t BLI_filesize(int file)
{
struct stat buf;
@@ -430,11 +430,11 @@
return (buf.st_size);
}
-int BLI_filepathsize(const char *path)
+size_t BLI_filepathsize(const char *path)
{
int size, file = open(path, O_BINARY|O_RDONLY);
- if (file < 0)
+ if (file == -1)
return -1;
size = BLI_filesize(file);
Modified: trunk/blender/source/blender/blenloader/intern/readblenentry.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readblenentry.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/blenloader/intern/readblenentry.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -28,6 +28,7 @@
* .blend file reading entry point
*/
+#include <stddef.h>
#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
#include <stdlib.h>
Modified: trunk/blender/source/blender/imbuf/IMB_imbuf.h
===================================================================
--- trunk/blender/source/blender/imbuf/IMB_imbuf.h 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/imbuf/IMB_imbuf.h 2010-09-15 06:43:36 UTC (rev 31935)
@@ -93,7 +93,7 @@
*
* @attention Defined in readimage.c
*/
-struct ImBuf *IMB_ibImageFromMemory(unsigned char *mem, int size, int flags);
+struct ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags);
/**
*
Modified: trunk/blender/source/blender/imbuf/intern/IMB_filetype.h
===================================================================
--- trunk/blender/source/blender/imbuf/intern/IMB_filetype.h 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/imbuf/intern/IMB_filetype.h 2010-09-15 06:43:36 UTC (rev 31935)
@@ -37,9 +37,9 @@
int (*is_a)(unsigned char *buf);
int (*ftype)(struct ImFileType *type, struct ImBuf *ibuf);
- struct ImBuf *(*load)(unsigned char *mem, int size, int flags);
+ struct ImBuf *(*load)(unsigned char *mem, size_t size, int flags);
int (*save)(struct ImBuf *ibuf, char *name, int flags);
- void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, int size, int tx, int ty, unsigned int *rect);
+ void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect);
int flag;
int filetype;
@@ -60,59 +60,59 @@
/* png */
int imb_is_a_png(unsigned char *buf);
-struct ImBuf *imb_loadpng(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags);
int imb_savepng(struct ImBuf *ibuf, char *name, int flags);
/* targa */
int imb_is_a_targa(unsigned char *buf);
-struct ImBuf *imb_loadtarga(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loadtarga(unsigned char *mem, size_t size, int flags);
int imb_savetarga(struct ImBuf * ibuf, char *name, int flags);
/* iris */
int imb_is_a_iris(unsigned char *mem);
-struct ImBuf *imb_loadiris(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags);
int imb_saveiris(struct ImBuf * ibuf, char *name, int flags);
/* jp2 */
int imb_is_a_jp2(unsigned char *buf);
-struct ImBuf *imb_jp2_decode(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags);
int imb_savejp2(struct ImBuf *ibuf, char *name, int flags);
/* jpeg */
int imb_is_a_jpeg(unsigned char *mem);
int imb_savejpeg(struct ImBuf * ibuf, char * name, int flags);
struct ImBuf * imb_ibJpegImageFromFilename (const char * filename, int flags);
-struct ImBuf * imb_load_jpeg (unsigned char * buffer, int size, int flags);
+struct ImBuf * imb_load_jpeg (unsigned char * buffer, size_t size, int flags);
/* bmp */
int imb_is_a_bmp(unsigned char *buf);
-struct ImBuf *imb_bmp_decode(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags);
int imb_savebmp(struct ImBuf *ibuf, char *name, int flags);
/* cocoa */
-struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, size_t size, int flags);
short imb_cocoaSaveImage(struct ImBuf *ibuf, char *name, int flags);
/* cineon */
int imb_savecineon(struct ImBuf *buf, char *myfil, int flags);
-struct ImBuf *imb_loadcineon(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loadcineon(unsigned char *mem, size_t size, int flags);
int imb_is_cineon(unsigned char *buf);
/* dpx */
int imb_save_dpx(struct ImBuf *buf, char *myfile, int flags);
-struct ImBuf *imb_loaddpx(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loaddpx(unsigned char *mem, size_t size, int flags);
int imb_is_dpx(unsigned char *buf);
/* hdr */
int imb_is_a_hdr(unsigned char *buf);
-struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags);
+struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags);
int imb_savehdr(struct ImBuf * ibuf, char *name, int flags);
/* tiff */
void imb_inittiff(void);
int imb_is_a_tiff(unsigned char *buf);
-struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags);
-void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, int size,
+struct ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags);
+void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size,
int tx, int ty, unsigned int *rect);
int imb_savetiff(struct ImBuf *ibuf, char *name, int flags);
void *libtiff_findsymbol(char *name);
Modified: trunk/blender/source/blender/imbuf/intern/allocimbuf.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/allocimbuf.c 2010-09-15 05:57:48 UTC (rev 31934)
+++ trunk/blender/source/blender/imbuf/intern/allocimbuf.c 2010-09-15 06:43:36 UTC (rev 31935)
@@ -32,6 +32,8 @@
/* It's become a bit messy... Basically, only the IMB_ prefixed files
* should remain. */
+#include <stddef.h>
+
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list