Version: 2.1 (using Devel) Installed from: Compiled sources Compiler: gcc 4.2.3 (Gentoo 4.2.3 p1.0) w/ mudflag and gentoo patches OS: Linux When viewing images in Konqueror they display in the Gwenview KPart (which is a step up btw!). If you do this for large enough images you can see KIO download the file. I was using widescreen wallpapers from Digital Blasphemy but it's apparent with any large image. When using Save As to save an image from the KPart, it is re-downloaded after choosing a location. Expected behavior: The first image downloaded somewhere, presumably a temporary file. It would be best to simply copy this file over to the final location. Either way it seems wasteful to download the image twice.
I'd make up a patch for it but: The only code that knows what the file name would be seems to be LoadingDocumentImpl (which doesn't have it saved to a file but to a QByteArray mData). Once the file is loaded, it switches to a different implementation and deletes itself. Now all we have is a QImage which trying to re-save could lose quality. Not sure how you want to do it but you'd need to save that QByteArray in between somehow.
You are right, the original is lost when LoadingDocumentImpl deletes itself, except in the case of JPEG files, because we need the raw data to perform lossless transformations. Maybe we could keep the data for all image types when viewing a remote url. In this case LoadingDocumentImpl should pass the raw data to DocumentLoadedImpl just like it does with JpegDocumentLoadedImpl.
Keeping the image data is what I would recommend. The alternative is saving it to a temp file and then deleting it on close but that will likely lead to having files cluttering the temp dir after time.
SVN commit 813314 by gateau: Keep raw data for remote urls if we are not embedded in Gwenview. BUG: 162141 M +6 -0 gvpart.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=813314