Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Line Tool crashes in #9

Open
psineur opened this issue Mar 31, 2012 · 3 comments
Open

Command Line Tool crashes in #9

psineur opened this issue Mar 31, 2012 · 3 comments
Labels

Comments

@psineur
Copy link
Owner

psineur commented Mar 31, 2012

Original message by Davewise from cocos2d-iphone.org forum:

I think something is going on with the latest version of tileCutter and png files. I grabbed the latest cocos2d-iphone-extensions 0.2 and opened up the cocos2d-extensions-ios.xcodeproj. I looked in the CCBigImageTest folder and noticed that the png files pointed to in the xcodeproj are replaced with jpg files. So I saved them as png files and changed prepareTiles.sh so that it would point to the png files. tileCutter will crash if you do this. Note that it didn't crash in the past when I tried this. You can try this yourself to see the results. Here is the output from my terminal:

./prepareTiles.sh
Preparing SD TilestileCutter(12199,0x100681000) malloc: *** error for object 0x102106be8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
./prepareTiles.sh: line 33: 12199 Abort trap: 6 ./tileCutter --rigidTilesSize --tileWidth 256 --tileHeight 256 --inputFile bigImage.png --outputFile tiles/bigImage
Preparing HD Tiles
tileCutter(12202,0x100681000) malloc: *** error for object 0x101012208: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
./prepareTiles.sh: line 37: 12202 Abort trap: 6 ./tileCutter --rigidTilesSize --tileWidth 512 --tileHeight 512 --inputFile bigImage-hd.png --outputFile tiles/bigImage --outputSuffix -hd
rm: tiles/bigImage-hd.plist: No such file or directory
Converting Tiles to pvr.ccz
Writing sprite sheet to bigImage_0_0.pvr.ccz
Writing data for cocos2d to out.plist
Resulting sprite sheet is 260x260.
@psineur
Copy link
Owner Author

psineur commented Mar 31, 2012

@alexeylang, you have Snow Leo, can you try to reproduce this on it please?
You just need to got to the extensions repo and then execute this from it's root:

cd Tests/CCBigImageTest/preparingResoures/
./prepareTiles.sh 

There might be bash errors about no texturePacker installed, but it shouldn't crash like in message above.
Thanks!

@davewise
Copy link

More info to add. This happens only when my input file is png and my output format is png. If I change my input file to something else. The crash goes away.

@zeraien
Copy link

zeraien commented Apr 27, 2012

I had the crash happen as well, using Lion, SDK 5.1 in XCode 4.3.2

According to the debugger, the crash happens here, in TileOperations.m:

143: NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations
            usingType:fileType properties:nil];

It seems to only happen when output is PNG.
Also I noticed that if setting the output to JPG OR commenting out the actual creation of the images, the "plist" file that is produced contains NO sizes, just {{nan,nan},{nan,nan}}, this might be related to #4 no?

My images are DPI 72 tho...

I fiddled with it for a few hours but couldn't figure out the problem. Now that I know about the sizes (and #4), maybe I'll give it another go...

Edit: probably nothing to do with the previously mentioned #4, I did at one point get the following error:

libpng error: invalid zlib compression method or flags in idat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants