texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] eps image is pixelated


From: Michael Lachmann
Subject: Re: [Texmacs-dev] eps image is pixelated
Date: Fri, 16 Aug 2013 16:11:59 +0200


On 16 August 2013 14:58, Miguel de Benito Delgado <address@hidden> wrote:
On 16 Aug, 2013, at 01:04, Michael Lachmann <address@hidden> wrote:

> Because it is cached by CRC, I don't think it should be a problem, unless people are opening the same file at the same time twice, and an image is not cached, yet. But one could create the image and move it to its location at the last moment, and then there should be no issue.

I see. Still some safety check will be needed.
I think that with the renaming scheme, you would just create the file twice, and then one version would delete the other. And all would work ok. 

> I noticed that when I open the file above, close it, and open it again, images load fast, which seems to imply that there is already some cacheing going on, as long as you don't quit TeXmacs.

In my machine the file loads fast (<1sec) and I notice no difference between first load and subsequent loads after closing the buffer. But scrolling sucks because each time the canvas is shifted, Ghostscript is called. Activating the in-memory caching system results in perfectly smooth scrolling as if no images were there.

Sorry, when I said above "load", I meant scrolling time. So, start TeXmacs, load the file, scroll to the bottom, you'll see significant delays. Scroll again, there are no delays. Close the file (but not TeXmacs), load it again, again scroll with no delays. Close TeXmacs, open it again, load the file, again scroll with delays.
 


Maybe we could simply activate the cache already implemented in src/Graphics/Picture/picture.cpp for all images as I suggested, then persistently store it?  Note that there already is some infrastructure to this end, in src/System/Misc/persistent.cpp.
For images embedded into files we could do the following: upon load they are currently assigned some unique name like ~/.TeXmacs/system/tmp/tmp_1234567890.eps, then converted using gs. Persistently storing the cache would achieve nothing in this situation because it is indexed by URL, it'd just fill up the drive. CRC seems the way to go here yes, but then the relevant parts of the code relying on these tmp_stuff.bla names could be changed to use the CRC as filename, and we may use the current cache and persistently store it.

So: persistent storage of the cache in src/Graphics/Picture/picture.cpp and by-CRC naming of the temporary files related to embedded images.

Thoughts?


I think that is the correct approach in terms of where to put it in TeXmacs. I have a bit of a hard time understanding how persistent_write() works. If I understand correctly, it isn't currently used, so we can't do much damage.
(I'm also not totally sure how safe that part is with respect to multiple instances of TeXmacs running).
Do you really have to change the tmp_stuff part? That seems like a big change. Couldn't you
just add caching by CRC (and requested width/height) instead of by filename?

Michael

reply via email to

[Prev in Thread] Current Thread [Next in Thread]