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

Served Images are corrupted #864

Closed
englercj opened this issue Dec 18, 2013 · 3 comments
Closed

Served Images are corrupted #864

englercj opened this issue Dec 18, 2013 · 3 comments
Milestone

Comments

@englercj
Copy link

On windows when I run my karma grunt task, images that are served via karma are corrupted and thus cause some of my tests to fail.

To see this happen you can clone Pixi.js and checkout the jshint branch:

git clone https://github.com/GoodBoyDigital/pixi.js.git -b jshint

Change the Gruntfile karma task to have singleRun: false so that the runner will not close and you can use Debug mode. After selecting the Debug button, open this URL in a new tab: http://localhost:9876/base/test/textures/bunny.png.

Notice that firefox reports the image contains errors. The actual image is fine, but the served image is broken. Here are my versions:

Windows 7 x64 (also tested on Windows 8 x64)

$ node -v
v0.10.22

$ npm -v
1.3.14

$ npm ls | grep karma
├─┬ [email protected]
├── [email protected]
├─┬ [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
├── [email protected]
├── [email protected]

This is the last issue blocking me from using karma in pixi, let me know if you need any other information!

@drkibitz
Copy link

I can confirm that this is broken with all versions of karma following 0.11.5
Versions prior to and including 0.11.5 are working as expected.

@drkibitz
Copy link

Well... the breakage happened somewhere in this comparison

76ee886...80637cd

Something do with caching/preprocessing changes.

@drkibitz
Copy link

Narrowed down to this commit 6e31cb2

drkibitz added a commit to drkibitz/karma that referenced this issue Jan 13, 2014
vojtajina added a commit that referenced this issue Feb 5, 2014
For binary files, we can't cache the content as a string (utf8), we need to use a binary buffer.

All the preprocessors are currently implemented to deal with strings, as that makes sense for text files. If we changed preprocessors to deal with buffers then each preprocessor would have to convert the buffer to a string, do the string manipulation and then convert it back to a buffer. I don't think that's worthy as there are no binary preprocessors.

This change disables preprocessing of binary files to avoid weird errors.
It shows warning. If there is a reasonable use case for preprocessing binary files we can figure out something.

Closes #864
Closes #885
vojtajina added a commit that referenced this issue Feb 5, 2014
For binary files, we can't cache the content as a string (utf8), we need to use a binary buffer.

All the preprocessors are currently implemented to deal with strings, as that makes sense for text files. If we changed preprocessors to deal with buffers then each preprocessor would have to convert the buffer to a string, do the string manipulation and then convert it back to a buffer. I don't think that's worthy as there are no binary preprocessors.

This change disables preprocessing of binary files to avoid weird errors.
It shows warning. If there is a reasonable use case for preprocessing binary files we can figure out something.

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

Successfully merging a pull request may close this issue.

2 participants