Open holzkohlengrill opened 6 years ago
Can you please attach your image or upload it somewhere?
Also, if this is a crash, maybe you can obtain a stack trace? The easiest is the stacktrace from Python when you run python with -X faulthandler
, but a proper stacktrace from debugger will also help.
I could not reproduce the crash anymore but the freezing with -X faulthandler
enabled and with an image I can share (as the console output says the reason is probably just the high resolution). My initial image was generated from a SVG. That's why I ended up with this extremely high resolution.
What -X faulthandler
outputs is the following: QImage: out of memory, returning null image
.
Before I saw also QFSFileEngine::open: No file name specified
. This is because I hat a typo in the path.
Output (shortened some redundant prints):
$ python.exe -X faulthandler ./retext.py
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QFSFileEngine::open: No file name specified
QImage: out of memory, returning null image
QImage: out of memory, returning null image
QImage: out of memory, returning null image
QImage: out of memory, returning null image
QImage: out of memory, returning null image
QImage: out of memory, returning null image
Process Process-1:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Program Files (x86)\Python37-32\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\holzkohlengrill\AppData\Local\Programs\retext\ReText\converterprocess.py", line 63, in _converter_process_func
job = receiveObject(conn_child)
File "C:\Users\holzkohlengrill\AppData\Local\Programs\retext\ReText\converterprocess.py", line 32, in receiveObject
sizeBuf = recvall(sock, 4)
File "C:\Users\holzkkohlengrill\AppData\Local\Programs\retext\ReText\converterprocess.py", line 23, in recvall
data = sock.recv(remaining)
ConnectionResetError: [WinError 10054] Eine vorhandene Verbindung wurde vom Remotehost geschlossen
(To avoid confusion: I just pressed Ctrl-c
at the end in order to exit)
===
Somehow I cannot load this image. I always get QFSFileEngine::open: No file name specified
. Does it work for you?
I saw this already for other images but did not have the time to carefully look at it. Possibly this might be a bug.
With this image everything works fine. However when I convert it with imagemagick (convert Big_Mandelbrot_set.jpg Big_Mandelbrot_set.png
) to png I get again QFSFileEngine::open: No file name specified
. Any other program is able to open it. Other "native" (meaning non-converted) png's work.
$ identify.exe Big_Mandelbrot_set*
Big_Mandelbrot_set.jpg JPEG 16000x12000 16000x12000+0+0 8-bit sRGB 16709300B 0.000u 0:00.004
Big_Mandelbrot_set.png PNG 16000x12000 16000x12000+0+0 8-bit sRGB 37.0583MiB 0.000u 0:00.000
O.K. I think I got it now for png's (for jpg it is still a little strange for me why we get two different error messages due to the same cause). It is again the size. However we get a misleading error. I just used this image as an example and generated several png's from it:
$ identify.exe SVG_logo*
SVG_logo-small.png PNG 400x400 400x400+0+0 8-bit sRGB 27155B 0.000u 0:00.000
SVG_logo.png PNG 13000x13000 13000x13000+0+0 8-bit sRGB 1.67808MiB 0.000u 0:00.000
SVG_logo.svg SVG 100x100 100x100+0+0 16-bit sRGB 9122B 0.047u 0:00.122
SVG_logo2.png PNG 4000x4000 4000x4000+0+0 8-bit sRGB 362025B 0.000u 0:00.000
SVG_logo3.png PNG 8000x8000 8000x8000+0+0 8-bit sRGB 869695B 0.016u 0:00.014
==== Currently I am testing on this commit: 37923cb1b74eb813714854503990b8a204b5610f
Somehow this issue got lost in my mailbox. Now I am reviewing old issues and got back to it.
Somehow I cannot load this image. I always get
QFSFileEngine::open: No file name specified
. Does it work for you?
Have you downloaded that image locally, or you are trying to load a remote image? I think such error may happen when the image is remote and you are using QTextBrowser viewer (not WebKit). That viewer does not support remote images at all. Or there is a typo somewhere in the file path…
Anyway, I just tried to open that file in a regular image viewer (eog) and it made my laptop hang. Looks like 4GB memory is not enough for it. So better I won't even try with ReText.
QImage: out of memory, returning null image
I doubt I can do anything about this. ReText uses Qt, which in turn uses libjpeg-turbo, so if there is inadequate memory consumption, it most probably lies in one of these two libraries.
Can you try to open the image in a file viewer using Qt, such as gwenview?
I only tested it with the Windows file viewer and on Xubuntu with ristretto and viewing the image was just fine.
Tried it with eog:
Wow, it's handled very inefficiently. eog
eats up all the memory and then just crashes.
I have the image locally (no remote loading).
I'm using ![](img.png)
but img.png
is a large image with high resolution.
How to force retext to fit the image width to the preview width?
Thanks!
@monperrus ReText in master already includes a style to fit images in preview: https://github.com/retext-project/retext/blob/16f15df808d8af077b38cd27c5878b5eb64f4cc2/ReText/tab.py#L204
In stable version you can achieve this by using attribute lists:
![caption](img.png){: width="100%" }
great, thanks. any idea on when the debian package will be updated to master?
Maybe in February…
When embedding large images into documents (no preview active) it seems that it is getting loaded within the main thread (btw. why is it loaded anyway and not only the reference/path to it). This might freeze ReText for a while or let it crash. Example code:
ReText: 7.1.0 (Git) PyMarkups: 3.0.0 Qt: 5.10.1 Python: 3.7.0b5