SOLVED: 'Invalid Bitmap File' issue in TGB 2D
by Jonathan R Hopkins · in Technical Issues · 08/30/2009 (7:21 pm) · 1 replies
Solution: The error was occurring because of an address issue. 'Invalid Bitmap File' was occuring because it couldn't find the bitmap file due to a bad address. The address 'data/images/cameras/camera105.jpg' should have been 'game/data/images/cameras/camera105.jpg'. This solved the issue. Thank you.
Problem:
So I recently expanded some code that includes new datablocks and changed the images those datablocks were using. The new images are bigger and higher quality, but the same format.
Before I had 394 images ("cameras") that were used, and I made an automated algorithm using TGB that created the datablocks and other data structures associated therein. But now, there are 1098 cameras, so using that same algorithm causes Torque to crash due to a memory overload, so I re-wrote the algorithm on the same principle but had it simply write an equivalent ".cs" file using the openForWrite and writeLine functions instead so Torque wasn't using the images yet.
Essentially the way everything works is the same, but now when I execute the code that contains the datablocks (see "A: Datablock code" below") the code returns an error "See B: Invalid Bitmap Error..." I have no idea why it is doing this. Any ideas?
I was thinking it could possibly a file size issue, or even a file dimension issue, but I have no idea where I'd find that kind of information if there were limitation and parameters on them.
A: Datablock Code
Note that I've tried changing the image name line several times. I've tried using ~/data, and ./data, with the same results, but different SrcBitmap(...) results. In ~/ and ./ it states SrcBitmap(/c01....) or something like that.
B: Invalid Bitmap Error:
C: Old Images versus new ones:
Old images
New images
Problem:
So I recently expanded some code that includes new datablocks and changed the images those datablocks were using. The new images are bigger and higher quality, but the same format.
Before I had 394 images ("cameras") that were used, and I made an automated algorithm using TGB that created the datablocks and other data structures associated therein. But now, there are 1098 cameras, so using that same algorithm causes Torque to crash due to a memory overload, so I re-wrote the algorithm on the same principle but had it simply write an equivalent ".cs" file using the openForWrite and writeLine functions instead so Torque wasn't using the images yet.
Essentially the way everything works is the same, but now when I execute the code that contains the datablocks (see "A: Datablock code" below") the code returns an error "See B: Invalid Bitmap Error..." I have no idea why it is doing this. Any ideas?
I was thinking it could possibly a file size issue, or even a file dimension issue, but I have no idea where I'd find that kind of information if there were limitation and parameters on them.
A: Datablock Code
//--- OBJECT WRITE BEGIN ---
new SimSet(set_ss) {
canSaveDynamicFields = "1";
new t2dImageMapDatablock(img_ss1) {
imageName = "data/images/cameras/camera105.jpg";
imageMode = "FULL";
frameCount = "-1";
filterMode = "SMOOTH";
filterPad = "1";
preferPerf = "1";
cellRowOrder = "1";
cellOffsetX = "0";
cellOffsetY = "0";
cellStrideX = "0";
cellStrideY = "0";
cellCountX = "-1";
cellCountY = "-1";
cellWidth = "0";
cellHeight = "0";
preload = "0";
allowUnload = "1";
};
new t2dImageMapDatablock(img_ss2) {
imageName = "data/images/cameras/camera106.jpg";
...
//The code continues on in the same fashion.Note that I've tried changing the image name line several times. I've tried using ~/data, and ./data, with the same results, but different SrcBitmap(...) results. In ~/ and ./ it states SrcBitmap(/c01....) or something like that.
B: Invalid Bitmap Error:
ImageMap(img_ss1)SrcBitmap(data/images/cameras/camera105.jpg) Error: 'Invalid Bitmap File!' (2) ImageMap(img_ss2)SrcBitmap(data/images/cameras/camera106.jpg) Error: 'Invalid Bitmap File!' (2) ImageMap(img_ss3)SrcBitmap(data/images/cameras/camera107.jpg) Error: 'Invalid Bitmap File!' (2) ... (The error continues on likewise...)
C: Old Images versus new ones:
Old images
- File size: 3 - 20 KB (varies)
- Dimensions:475x300
- Format:.jpg
New images
- File size: 50 - 200 KB (varies)
- Dimensions:1900x1200
- Format:.jpg
Torque Owner Jonathan R Hopkins