Sublime Forum

Disable image viewer?

#1

Hi. Yesterday I wanted to open a jpg file with Sublime text, just to see the code of its header, but instead of this, the program displays the image. What is this??!! This also happens with .icos and other media files. I already have ACDSee or Photoshop for that. Is there any way to disable this and make the program opens any file as text?

And how to I change from normal text editor to HEX editor?

2 Likes

#2
1 Like

#3

I’ve tried installing the package called Hex Viewer, but it doesn’t do anything. There’s an option in the user config of this package (“auto_open” : true,) which should override this and open media files with a hex editor. Still no success.

1 Like

#4

Author of HexViewer here. HexViewer cannot view the hex of images currently as SublimeText image views are not traditional views. You can’t get the filename from those views. It is a frustrating change. I appreciate the image previewer, but I wish you could at the very least, you could get file info from image previews.

2 Likes

#5
// Auto open binary files in hex viewer
// Detects if view has encoding set to 'Hexidecimal'.
// Addtionally it can use 'auto_open_patterns' below.
"auto_open" : true

Hi. Thanks for your answer. Then, can you please clarify what is this option for?

Oh, and let me ask someting about your fantastic package: I’ve configured it to run with ctrl+alt+h, but is there any menu entry added to Sublime Text 3 somewhere to select or toggle ascii and hex views?

1 Like

#6

Is there an issue for this?

1 Like

#7

This is the only related issue I found: https://github.com/SublimeTextIssues/Core/issues/818.

1 Like

#8

Then, can you please clarify what is this option for?

It’s covered in the documentation: http://facelessuser.github.io/HexViewer/#auto_open.

but is there any menu entry added to Sublime Text 3 somewhere to select or toggle ascii and hex views?

In the command palette. You’d have to put something similar in your menu file if you wanted a drop down menu. I just use command palette though: http://facelessuser.github.io/HexViewer/#hexviewer-toggle-hex-view.

1 Like

#9

By the way, you can get the filename of an image via

sublime.active_window().extract_variables().get('file')
8 Likes

#10

What! :astonished:. Starting in what version?

1 Like

#11

The SFTP package has used that since Nov 2015, so at least 3095 had it.

2 Likes

#12

This makes me so happy. Hopefully I can easily tie the name to the appropriate sheet. I’d like to close the sheet with the preview and then open a hex view of it. I’ll have to check it out.

1 Like

#13

Looks like I can convert png files to hex now. Image previews are sheets and don’t go through on_load events, so I cannot auto convert them to hex, but at least I can toggle them :slight_smile:.

2 Likes

#14

Use KrojamSoft PhotoViewerPro because I was also involved such kind problem but now everything is perfect.

0 Likes

#15

Any update to this problem? I was able to edit hex of sublime_text3.exe to bypass this. But in latest version 3200, can’t do that anymore.

0 Likes

#16

seem this dev never care

0 Likes

#17

there are no update available since last update

0 Likes

#18

I was most surprised that my favourite text editor shows an image file as an image and not hex.

@facelessuser how do I ‘toggle them’?

Currently using Notepad :frowning:

0 Likes

#19

Assuming you have the HexViewer plugin installed, you can run the HexViewer: Toggle Hex View command. Image views don’t get the same events that text views do, so I don’t think you can auto-detect and convert to hex, but you can manually do it.

1 Like

#20

Now I’ve HexViewer installed I understand. Looks awesome tool - thank you!

0 Likes