Very low image resolution in desktop app

8.3

New Member
Jun 6, 2023
1
0
32
When viewing busts in the desktop app, they always appear very blurry. When inspecting them and setting the scale to 1:1 they always show as thumbnail size. Double checked the web ver and all images are full scale. The smoothing option does not change the quality.
 

Attachments

  • 2023-06-06 13_33_29-Trials in Tainted Space desktop app.png
    2023-06-06 13_33_29-Trials in Tainted Space desktop app.png
    293.1 KB · Views: 8
  • 2023-06-06 13_36_30-Trials in Tainted Space - Vivaldi webapp.png
    2023-06-06 13_36_30-Trials in Tainted Space - Vivaldi webapp.png
    730 KB · Views: 8
  • 2023-06-06 13_36_58-Trials in Tainted Space - Vivaldi Webapp.png
    2023-06-06 13_36_58-Trials in Tainted Space - Vivaldi Webapp.png
    513.5 KB · Views: 7
  • 2023-06-06 13_37_43-Trials in Tainted Space desktop app.png
    2023-06-06 13_37_43-Trials in Tainted Space desktop app.png
    188.2 KB · Views: 8

XBoxMaster131

Well-Known Member
Oct 18, 2016
4,712
1,326
When viewing busts in the desktop app, they always appear very blurry. When inspecting them and setting the scale to 1:1 they always show as thumbnail size. Double checked the web ver and all images are full scale. The smoothing option does not change the quality.
Maybe the zipping and unzipping compressed the images somehow?

Dammit now I'm kinda tempted to switch over to the desktop version... I'll have to look into this.
 

fndom

Member
Dec 8, 2016
6
0
47
Same here. The problem is that the source files are that small (check 'resources > app > resources > img' folder). Don't know why or if there's some way to get bigger ones. At least looking at the images that appear on the wiki, it does not seem that it is due to the resolution of the originals.
 

ensembien

Member
Jul 27, 2023
15
1
Well, there is an updater in main.js, and it's exposed to the outer world as electronAPI in preload.js, so you can use that to get the x2 images used in the web version.
(*) electronAPI.checkManifest() - build the list of files for downloading.
(*) electronAPI.downloadImages() - download the files.
(*) electronAPI.installImages() - install the downloaded files - copy them to the game folder.
(*) electronAPI.clearImages() - remove BOTH downloaded and installed files.
(*) electronAPI.downloadImagesCancel() - cancel an ongoing download.

Here's an example wrapper.
Code:
var g_my_updater = (function(){
    var log = console.error.bind(console);
    function format_size(n){
        var u = "bytes";
        [[1024 * 1024, "MB"], [1024, "KB"]].some((a) => n >= a[0] && (n = Math.round((n / a[0])* 100) / 100, u = a[1], 1));
        return n + " " + u;
    }

    // The API is broken - there's no way to remove an event listener installed from
    // the console: list[i] === listener in EventEmitter.prototype.removeListener()
    // won't return true.
    // handleAcquireImages() (aka "acquireImages:start", electronAPI.downloadImages())
    // calls checkManifest() if the download is cancelled, and checkManifest() calls
    // hasImagesAvailableForUpdate() which fires an event "acquireImages:notifyAvailable"
    // for which we have a handler installed. Hence this flag |cancelled|.
    var cancelled = false;
    var updating = false;

    function update()
    {
        if (updating) { log("ERROR: another update is in progress."); return; }
        updating = true;
        if (cancelled) { log("ERROR: waiting for a previous download to stop."); return; }
        log("Checking the manifest...");
        electronAPI.notifyHasImagesAvailable((a, num_files, size) => {
            if (cancelled) { log("Cancelled."); cancelled = false; return; }
            if ( ! num_files) { log("No files to download."); return; }
            log("Downloading " + num_files + " files, total size " + format_size(size));
            electronAPI.notifyDownloadProgress((a, num) => log("Downloaded files: " + num + " of " + num_files));
            electronAPI.notifyDownloadComplete(() => {
                log("Download complete, installing...");
                electronAPI.notifyHasImagesInstalled((a, ok) => {updating = false; log("Installed: " + ok);});
                electronAPI.installImages().catch(res => log("ERROR: installImages: ", res));
            });
            electronAPI.downloadImages().catch(res => log("ERROR: downloadImages: ", res));
        });
        electronAPI.checkManifest().catch(res => log("ERROR: checkManifest: ", res));
    }

    function cancel()
    {
        cancelled = true;
        electronAPI.downloadImagesCancel();
    }

    function clear()
    {
        if (updating) { log("ERROR: another update is in progress."); return; }
        electronAPI.clearImages();
    }

    return {update: update, cancel: cancel, clear: clear};
})();

Usage:
g_my_updater.update() - download and install the x2 images.
g_my_updater.cancel() - cancel an ongoing download.
g_my_updater.clear() - delete the downloaded images.
 

fndom

Member
Dec 8, 2016
6
0
47
Well, there is an updater in main.js, and it's exposed to the outer world as electronAPI in preload.js, so you can use that to get the x2 images used in the web version.
(*) electronAPI.checkManifest() - build the list of files for downloading.
(*) electronAPI.downloadImages() - download the files.
(*) electronAPI.installImages() - install the downloaded files - copy them to the game folder.
(*) electronAPI.clearImages() - remove BOTH downloaded and installed files.
(*) electronAPI.downloadImagesCancel() - cancel an ongoing download.

Here's an example wrapper.
Code:
var g_my_updater = (function(){
    var log = console.error.bind(console);
    function format_size(n){
        var u = "bytes";
        [[1024 * 1024, "MB"], [1024, "KB"]].some((a) => n >= a[0] && (n = Math.round((n / a[0])* 100) / 100, u = a[1], 1));
        return n + " " + u;
    }

    // The API is broken - there's no way to remove an event listener installed from
    // the console: list[i] === listener in EventEmitter.prototype.removeListener()
    // won't return true.
    // handleAcquireImages() (aka "acquireImages:start", electronAPI.downloadImages())
    // calls checkManifest() if the download is cancelled, and checkManifest() calls
    // hasImagesAvailableForUpdate() which fires an event "acquireImages:notifyAvailable"
    // for which we have a handler installed. Hence this flag |cancelled|.
    var cancelled = false;
    var updating = false;

    function update()
    {
        if (updating) { log("ERROR: another update is in progress."); return; }
        updating = true;
        if (cancelled) { log("ERROR: waiting for a previous download to stop."); return; }
        log("Checking the manifest...");
        electronAPI.notifyHasImagesAvailable((a, num_files, size) => {
            if (cancelled) { log("Cancelled."); cancelled = false; return; }
            if ( ! num_files) { log("No files to download."); return; }
            log("Downloading " + num_files + " files, total size " + format_size(size));
            electronAPI.notifyDownloadProgress((a, num) => log("Downloaded files: " + num + " of " + num_files));
            electronAPI.notifyDownloadComplete(() => {
                log("Download complete, installing...");
                electronAPI.notifyHasImagesInstalled((a, ok) => {updating = false; log("Installed: " + ok);});
                electronAPI.installImages().catch(res => log("ERROR: installImages: ", res));
            });
            electronAPI.downloadImages().catch(res => log("ERROR: downloadImages: ", res));
        });
        electronAPI.checkManifest().catch(res => log("ERROR: checkManifest: ", res));
    }

    function cancel()
    {
        cancelled = true;
        electronAPI.downloadImagesCancel();
    }

    function clear()
    {
        if (updating) { log("ERROR: another update is in progress."); return; }
        electronAPI.clearImages();
    }

    return {update: update, cancel: cancel, clear: clear};
})();

Usage:
g_my_updater.update() - download and install the x2 images.
g_my_updater.cancel() - cancel an ongoing download.
g_my_updater.clear() - delete the downloaded images.
Wow thanks for that. Unfortunately I have no clue what to do with it. I've only been able to have a look at the main and preload files' code :(
 

ensembien

Member
Jul 27, 2023
15
1
This code is supposed to be used in the JavaScript console aka Developer Tools. To open the console, press Ctrl+Shift+I. Alternatively, press Alt to show the menu bar -> View -> Toggle Developer Tools.

If this is "too much" for you, I'm attaching a script that should make it easier. It adds an "IMAGE PACK" button on the sidebar on the left, right above the menu and panic buttons at the bottom. Clicking it, shows a separate screen where you can install or uninstall the image pack.
First you need to check for an update using the Check button, and if there is, you'll be able to install it using the Install button.
You can cancel the installation process using the Cancel button.

Extract the script to the subfolder "resources\app" (where index.html is), and include it in index.html right before the closing </body> tag like this:
Code:
<script type="text/javascript" src="z117_image_pack.js"></script>

Currently, the last line of the original index.html looks like this:
Code:
        }</script></body></html>
And after your edit it should look like this:
Code:
        }</script><script type="text/javascript" src="z117_image_pack.js"></script></body></html>
 

Attachments

  • z117_image_pack.zip
    5.6 KB · Views: 16
  • Like
Reactions: fndom

fndom

Member
Dec 8, 2016
6
0
47
This code is supposed to be used in the JavaScript console aka Developer Tools. To open the console, press Ctrl+Shift+I. Alternatively, press Alt to show the menu bar -> View -> Toggle Developer Tools.

If this is "too much" for you, I'm attaching a script that should make it easier. It adds an "IMAGE PACK" button on the sidebar on the left, right above the menu and panic buttons at the bottom. Clicking it, shows a separate screen where you can install or uninstall the image pack.
First you need to check for an update using the Check button, and if there is, you'll be able to install it using the Install button.
You can cancel the installation process using the Cancel button.

Extract the script to the subfolder "resources\app" (where index.html is), and include it in index.html right before the closing </body> tag like this:
Code:
<script type="text/javascript" src="z117_image_pack.js"></script>

Currently, the last line of the original index.html looks like this:
Code:
        }</script></body></html>
And after your edit it should look like this:
Code:
        }</script><script type="text/javascript" src="z117_image_pack.js"></script></body></html>
Thanks a lot! I actually tried with the attached file and it worked just great. Much appreciated kind sir :)