ColorHighlighter icon indicating copy to clipboard operation
ColorHighlighter copied to clipboard

convert error

Open yuchisu opened this issue 8 years ago • 34 comments

console error message

convert error:
'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte

and CH dosen't work with many color codes qq 20160307172459

yuchisu avatar Mar 07 '16 09:03 yuchisu

Two Colors below work, see screen capture lines 24, 25

color: #68CDD0; /* these colors work / color: #22292C; / these colors work */

colorhighlighter-demo-css-2-colors-ok

What version of Sublime Text are you using?

What are contents of following files:

Preferences > Package Settings > Color Highlighter > Settings - User

colorhighlighter-preferences-package-setting-default

Preferences > Package Settings > Color Highlighter > Settings - Default

colorhighlighter-preferences 2

Have you tried uninstalling and reinstalling Color Highlighter?

Js-GitHub avatar Mar 07 '16 12:03 Js-GitHub

@yuchisu Please, try the code from this commit: https://github.com/Monnoroch/ColorHighlighter/commit/ba05905d37f7f63b3baf556bb2681d11fab901ef. This won't fix the issue, but will give additional debug info.

Monnoroch avatar Mar 07 '16 12:03 Monnoroch

@Js-GitHub I'm sorry I didn't give enough information cause this is my first time to ask a question on github. I'm using the ST3 Build 3103 on win10. And I've tried reinstalling CH. I find it works normally when I'm taking the screenshot, but it get lose again after I restart the ST.

qq 20160307214315 qq 20160307172459

yuchisu avatar Mar 07 '16 13:03 yuchisu

@yuchisu No problem, I'm new myself.

Save copy of: Preferences > Package Settings > Color Highlighter > Settings - User
Remove everything from file above except following:
Set "ha_style": "filled"

colorhighlighter-preferences-package-setting-default

Lets start out with basics to troubleshoot and once we get it working you can customize
"enable": true... not needed as it's already true in Settings - Default
Not sure what "ha_icons & style" does so lets use what's in Settings - Default for now
Create a file named: "color_highlighter_demo.css" with following code so we're comparing apples to apples:
/*ColorHighlighter Demo */

.class {
    color: black;
    color: #000;
    color: white;
    color: #FFF;
    color: grey;
    color: red;
    color: #F00;
    color: green;
    color: #0F0;
    color: blue;
    color: #00F;
    color: gold;
    color: pink;
    color: fuchsia;
    color: lime;
    color: purple;
    color: brown;
    color: orange;
    color: lightblue;
    color: yellow;
    color: #68CDD0;  /* these colors work */
    color: #22292C;   /* these colors work */
}

Save all changes above. Restart Sublime Text ( exit / close it, then reopen it ).

Open "color_highlighter_demo.css" file

What are color_scheme & theme set to in: Preferences > Settings - User
Mine are following. You don't have to change yours. Including for reference only.

color_scheme_n_theme

"color_scheme": "Packages/Neon Color Scheme/Neon.tmTheme", theme": "Material-Theme-Darker.sublime-theme",

Js-GitHub avatar Mar 07 '16 14:03 Js-GitHub

@Js-GitHub thx a lot. I've set all of above to default and saved. The last status turns out not working. qq 20160307214315

And the console error message qq 20160307214315

yuchisu avatar Mar 07 '16 15:03 yuchisu

I can't reproduce this on Ubuntu Linux. My guess is that's an issue with the encoding of the CLI on Windows.

Cybolic avatar Mar 07 '16 15:03 Cybolic

@yuchisu I'll look at it later. In the interim google the last two lines in error output starting with:

convert error: 'utf-8'...

Js-GitHub avatar Mar 07 '16 17:03 Js-GitHub

I'm using ST3 on Windows 10 and all screen captures above were from Win 10.

Also have ST3 on Ubuntu, but not using ST3 on Ubuntu much lately.

Js-GitHub avatar Mar 07 '16 18:03 Js-GitHub

@Js-GitHub Allright, I think I'll give up. I've uninstalled the ST3, deleted the files in Appdata reinstalled and reinstalled it, but the issue still be there. qq 20160307172459 qq 20160307214315

Maybe wo could end this discussion.

yuchisu avatar Mar 08 '16 03:03 yuchisu

Don't I've up just yet. We'll look at it tomorrow. There's an explanation and possibly solution or bug fix...

Js-GitHub avatar Mar 08 '16 03:03 Js-GitHub

Checkout this link

https://github.com/Monnoroch/ColorHighlighter/issues/112

I believe it may be workaround...

Js-GitHub avatar Mar 08 '16 03:03 Js-GitHub

@Js-GitHub Thx, I was just working on the packages installing ... I'm looking #112 now.

yuchisu avatar Mar 08 '16 03:03 yuchisu

That's not solution. I'm driving.

Js-GitHub avatar Mar 08 '16 04:03 Js-GitHub

@Js-GitHub I've gave up, it's too difficult to solve this...

yuchisu avatar Mar 08 '16 05:03 yuchisu

What causes convert error? When does it happen? What do you have to do cause error?

Js-GitHub avatar Mar 09 '16 00:03 Js-GitHub

@Js-GitHub I don't know, I've ignored the problem. Anyway,it works on most of the color codes.

yuchisu avatar Mar 09 '16 00:03 yuchisu

@yuchisu Try what Monnoroch suggested...

Please, try the code from this commit: ba05905 This won't fix the issue, but will give additional debug info.

Js-GitHub avatar Mar 09 '16 01:03 Js-GitHub

@Js-GitHub Actually I don't know where to put the file...

yuchisu avatar Mar 09 '16 01:03 yuchisu

@Monnoroch Do we just run the code inside ST3 ba05905

Js-GitHub avatar Mar 09 '16 01:03 Js-GitHub

@Js-GitHub Well, I think package control should have updated the plugin by now, so just update, wait for this error and post the console log here.

Monnoroch avatar Mar 09 '16 01:03 Monnoroch

@Monnoroch Should @yuchisu download file and run it inside ST3? ColorHighlighter.py

Does it change anything or just collect data?

Once it's run, do you want them to post output here?

I'm on cellphone so can't view much on my screen.

Js-GitHub avatar Mar 09 '16 01:03 Js-GitHub

@Monnoroch Please elaborate on what you mean by update? Provide steps or instructions.

Js-GitHub avatar Mar 09 '16 01:03 Js-GitHub

@Js-GitHub Thank god,finally I get the file run. Traceback (most recent call last): File "C:\Users\ADMINI~1\AppData\Local\Temp\BNZ.56df8191916c6f7\ColorHighlighter.py", line 3, in <module> import sublime, sublime_plugin ImportError: No module named 'sublime' [Finished in 0.1s with exit code 1] [shell_cmd: python -u "C:\Users\ADMINI~1\AppData\Local\Temp\BNZ.56df8191916c6f7\ColorHighlighter.py"] [dir: C:\Users\ADMINI~1\AppData\Local\Temp\BNZ.56df8191916c6f7] [path: C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\Administrator\AppData\Local\Programs\Python\Python35;C:\Users\Administrator\AppData\Local\Programs\Python\Python35\Scripts\;C:\Program Files\Bandizip\7z;C:\Users\Administrator\AppData\Local\atom\bin]

yuchisu avatar Mar 09 '16 02:03 yuchisu

@yuchisu Nope, you didn't. As I told you, you just needed o update the plugin via Package Control.

Monnoroch avatar Mar 09 '16 11:03 Monnoroch

@Monnoroch
qq 20160307172459

But this told me there are no packages ready for upgrade.

yuchisu avatar Mar 09 '16 15:03 yuchisu

Maybe it already had it upgraded?

Monnoroch avatar Mar 09 '16 17:03 Monnoroch

@Monnoroch Know you are busy and appreciate your help.

But what are next steps?

What should @yuchisu Try now to help you isolate and identify issue?

Will running ColorHighlighter.py provide any additional info?

ColorHighlighter.py imports sublime. How does one install sublime module for python? pip install sublime?

Js-GitHub avatar Mar 09 '16 18:03 Js-GitHub

@Js-GitHub No-no, nothing like that. You just have to wait until the bug reveals itself and paste the console log here.

Monnoroch avatar Mar 09 '16 18:03 Monnoroch

@yuchisu Seems like you are able to reproduce the problem 100% whenever you open a CSS file that contains the reference to the color: #22292C;

In sublime text do following: a. Menu bar > View > Show Console b. Open the "color_highlighter_demo.css" file you created earlier c. the "convert error" message should pop up d. paste contents here.

To isolate the problem even future: a. close all open files in sublime text b. create another css file named color_highlighter_one_color.css c. put following line in it ( to test that color only ) since that is what error message shows

color_highlighter_one_color

d. Open the color_highlighter_one_color.css e. You should get same error f. post that error here also

Make sure you label output so monnoroch knows console output is associated with each file.

Js-GitHub avatar Mar 09 '16 18:03 Js-GitHub

While I open the "color_highhlighter_demo.css"file, there's no error pop up. I click on "#22292C", it comes CONVERT CALL: convert -type TrueColorMatte -channel RGBA -size 32x32 -alpha transparent xc:none -fill "#22292CFF" -draw "circle 15,16 8,10" png32:"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\User\Color Highlighter\icons\22292CFF" convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte CONVERT CALL: convert -type TrueColorMatte -channel RGBA -size 32x32 -alpha transparent xc:none -fill "#22292CFF" -draw "circle 15,16 8,10" png32:"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\User\Color Highlighter\icons\22292CFF" convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte

I open the "color-highlighter-demo.css" file just contain "#22292C" , it comes CONVERT CALL: convert -type TrueColorMatte -channel RGBA -size 32x32 -alpha transparent xc:none -fill "#22292CFF" -draw "circle 15,16 8,10" png32:"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\User\Color Highlighter\icons\22292CFF" convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte CONVERT CALL: convert -type TrueColorMatte -channel RGBA -size 32x32 -alpha transparent xc:none -fill "#22292CFF" -draw "circle 15,16 8,10" png32:"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\User\Color Highlighter\icons\22292CFF" convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte CONVERT CALL: convert -type TrueColorMatte -channel RGBA -size 32x32 -alpha transparent xc:none -fill "#22292CFF" -draw "circle 15,16 8,10" png32:"C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Packages\User\Color Highlighter\icons\22292CFF" convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte

yuchisu avatar Mar 10 '16 05:03 yuchisu

@Monnoroch I've removed the CH ,delete the CH folder and reinstalled the CH. But it still remained unsolved as above.

yuchisu avatar Mar 10 '16 06:03 yuchisu

Hi @yuchisu, you has installed this: ImageMagick The convert error: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte is why ImageMagick isn't in your PATH. Try this: http://www.imagemagick.org/download/binaries/ImageMagick-6.9.3-7-Q16-x64-dll.exe if the Windows 10 is x64 or http://www.imagemagick.org/download/binaries/ImageMagick-6.9.3-7-Q16-x86-dll.exe if the Windows is x86

LOQUILLO avatar Mar 28 '16 00:03 LOQUILLO

@LOQUILLO Thank you very much, it works.

yuchisu avatar Mar 28 '16 04:03 yuchisu

I had the problem too(windows os) and there's a simple way: edit colorhighlighter user settings

{
    "icons": false,
}

xhlwill avatar Feb 16 '17 06:02 xhlwill