Skip to content

Error: PNG file appears to be corrupted by text file conversions #1382

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

Closed
jasonbaik opened this issue Oct 20, 2015 · 7 comments
Closed

Error: PNG file appears to be corrupted by text file conversions #1382

jasonbaik opened this issue Oct 20, 2015 · 7 comments

Comments

@jasonbaik
Copy link

Using angular fullstack v2.1.1

The build seems to be hanging up when hitting imagemin. What's new is when I commit images to github, it shoots a crlf to lf warning too.

Anyone run into this as well?

@Awk34
Copy link
Member

Awk34 commented Oct 20, 2015

@Awk34 Awk34 added the question label Oct 20, 2015
@jasonbaik
Copy link
Author

That is the answer. Thank you good sir.

@Awk34 Awk34 closed this as completed Oct 20, 2015
@harelba
Copy link

harelba commented Nov 28, 2015

Hi,

I've struggled with the same issue, and it does seem related to the way git handles line ending translation on each checkout.

Edited to clarify: The issue doesn't happen when doing everything locally, it only happens when bouncing the codebase through git, and might be the root cause for issues #557 and #96 as well. The corruption happens as soon as the image file is checked out from the git repository, and unrelated to the specific stage where imagemin is being run.

Two questions:

  1. What was the reason for adding the .gitattributes with * text eol=lf in the first place? In many other cases I've seen, there's no need for it in the first place.
  2. If for some reason, the fie is needed, wouldn't it be better if the generator would create the more specific definitions? For example, if it's a specific file that needs lf line endings, then just define the relevant files there, and leave everything else as auto, or at least add the *.png and such to the file.

WDYT?

@Awk34
Copy link
Member

Awk34 commented Nov 29, 2015

@harelba Yeah specific text definitions would be better. I just haven't gotten around to it. A PR would be welcome.

@Awk34 Awk34 reopened this Nov 30, 2015
@Awk34 Awk34 added this to the 3.1.0 milestone Nov 30, 2015
@harelba
Copy link

harelba commented Nov 30, 2015

@Awk34 I'd be glad to send a PR for this. However, my own solution was to eventually remove .gitattributes altogether, and change the global core.autocrlf flag to false before checking out, so multi-platform checkouts would work well (I actually had to delete my entire git repository, since the original image data there was corrupted, and the "modified" check of git status was thrown off by this as well).

Do you happen to know what was the original reason for adding the .gitattributes file? At first I was under the impression that it's needed for one of the configuration files, at least for now, it seems that things are working fully well without it.

Harel

@harelba
Copy link

harelba commented Nov 30, 2015

@Awk34 I'm missing something - This change seems to have been already added at Sep 6 in b825585 to the master.

Sorry if this is a silly question, but is there a need for an additional PR on this matter? I'd be glad to do it if the answer is yes.

Harel

@Awk34
Copy link
Member

Awk34 commented Dec 1, 2015

It would probably be better to mark specific files (js, html, css, etc) as text with lf endings, instead of everything except for those four image types

Awk34 added a commit that referenced this issue Dec 20, 2015
Awk34 added a commit that referenced this issue Dec 20, 2015
@Awk34 Awk34 closed this as completed May 6, 2016
W3stside added a commit to gnosis/dx-react that referenced this issue Dec 8, 2017
W3stside added a commit to gnosis/dx-react that referenced this issue Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants