retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.88k stars 196 forks source link

ReText 5.2.1 on Win 7 Pro 64bit doesn't find image files in directory where markdown file is located #161

Closed UNIVAC-Colonel-Panic closed 8 years ago

UNIVAC-Colonel-Panic commented 9 years ago

If I specify an image in the markdown file using a relative path like this:

![](coverpage.jpg)

and I put coverpage.jpg in the same directory as the markdown file, the image displays as expected when I run ReText on Fedora 21 but on Windows it shows a sort of blank thumbnail instead of the image.

How do I find out what default directory ReText is using when looking for images?

mitya57 commented 9 years ago

ReText should change directory every time it changes the file: https://github.com/retext-project/retext/blob/master/ReText/window.py#L757

It would be nice if you could check whether that call succeeds on Windows or not.

UNIVAC-Colonel-Panic commented 8 years ago

Sorry, I don't understand how to "check whether that call succeeds on Windows or not"?

Under Windows, if I do a Save As (which is what L757 in the link above seems to be directing me to do), the default directory is the one containing the markdown file I'm editing and the image it should be finding.

When I launch ReText with preview enabled on startup, the blank thumbnail/placeholder/whatever it is called appears. If "ReText should change directory every time it changes the file" then I think this means I have to do some sort of change before it would change the directory so the image will be displayed? Can you tell me what sort of change I need to initiate to force the image to appear? And do I need to save the change first and then ReText will display the image?

mitya57 commented 8 years ago

If the Save dialog contains the current directory, then the directory change works.

Does saving the file help to display the image? Are you using the WebKit previewer? Can you try switching it on/off (via the Edit menu)?

UNIVAC-Colonel-Panic commented 8 years ago

Hi mitya57,

The image does not display using the WebKit previewer nor the "regular" previewer (whatever it's called).

Saving the file doesn't make a difference. To test this I did the following:

1) made a change to the doc while WebKit previewer was active, then did SAVE. 2) same as 1 but with the "regular" previewer active. 3) same as 1 but did SAVE AS and used different name 4) same as 2 but did SAVE AS and used different name

For all of these tests, the image doesn't get displayed.

mitya57 commented 8 years ago

I think it's a bug not in ReText but somewhere else — probably in Qt.

Can you try changing coverpage.jpg to ./coverpage.jpg or to the absolute path?

mitya57 commented 8 years ago

Closing because of no feedback.