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

Infinite loop on small images #66

Open
roed opened this issue Jun 18, 2019 · 11 comments
Open

Infinite loop on small images #66

roed opened this issue Jun 18, 2019 · 11 comments

Comments

@roed
Copy link

roed commented Jun 18, 2019

Mac user here. It seems that when I use images smaller than 10px (10px width, 9px height, png), the application hangs and seems to go in an infinite loop. It says: Optimizing atlas in the bottom right corner. I have to force quit it to stop it. When I use an image of 10x10px, it's fine. I searched in the source code, but I am having a hard time to find out why it does that. There is a for and while loop after that statement that displays the message:

bool SpriteAtlas::packWithRect(const QVector<PackContent>& content) {
@amakaseev
Copy link
Owner

Hi, please send me examples of files which cause this mistake, and the file of the project with settings

@roed
Copy link
Author

roed commented Jun 21, 2019

spider

json of the project file:

{
    "algorithm": "Rect",
    "dataFormat": "pixijs",
    "destPath": "../../assets",
    "encryptionKey": "",
    "epsilon": 15,
    "heuristicMask": false,
    "imageFormat": "*.png",
    "jpgQuality": 80,
    "pixelFormat": "ARGB8888",
    "pngOptLevel": 7,
    "pngOptMode": "None",
    "premultiplied": true,
    "prependSmartFolderName": true,
    "rotateSprites": false,
    "scalingVariants": [
        {
            "forceSquared": false,
            "maxTextureSize": 2048,
            "name": "",
            "pow2": false,
            "scale": 1
        }
    ],
    "spriteBorder": 0,
    "spriteSheetName": "spritesheet",
    "srcList": [
    ],
    "textureBorder": 0,
    "trimMode": "Rect",
    "trimSpriteNames": true,
    "trimThreshold": 0,
    "webpQuality": 80
}

@amakaseev
Copy link
Owner

I used this sprites:
11
22
33

and sprite sheet worked correctly

@roed
Copy link
Author

roed commented Jun 21, 2019

did you also try the sprite I provided?

@amakaseev
Copy link
Owner

i found mistake
int step = (w + h) / 20;

incorrect calculate steps
try fix this: int step = max( (w + h) / 20, 1);

@roed
Copy link
Author

roed commented Jun 21, 2019

ah, so It would resolve to 0, hanging somewhere without doing any steps?

@amakaseev
Copy link
Owner

yes, see last commit
Thanks for the help :)

@roed
Copy link
Author

roed commented Jun 21, 2019

Nice. Btw, the latest release is from 2017, will you create a new release soon?

@amakaseev
Copy link
Owner

Oh I did not do it so long ago:)

@roed
Copy link
Author

roed commented Jun 21, 2019

37 commits behind master ;)

@jjhesk
Copy link

jjhesk commented Aug 11, 2019

crashed when i choose a smaller size of the sprite sheet

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

No branches or pull requests

3 participants