Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Save screenshots with timestamp in file name #926

Open
ReyVGM opened this issue May 27, 2024 · 12 comments
Open

Request: Save screenshots with timestamp in file name #926

ReyVGM opened this issue May 27, 2024 · 12 comments

Comments

@ReyVGM
Copy link

ReyVGM commented May 27, 2024

Hello team.

I'm requesting a small change to the sequential way snes9x saves and numbers the screenshots you take. This is going to sound stupid, but I assure you it's an annoyance for people that take screenshots.

Let me try to explain. I take tons of sequential images and I usually delete redundant images as I play the game so I don't forget later.

The problem is that when you delete an image that's in the middle of a group of images, then the next time you press the screenshot key, the emulator "refills" that gap with a new image instead of continuing with the next number in the sequence.

So, for example, if you have:

pic 1.png
pic 2.png
pic 3.png

If you delete "pic 2.png", then the next time you press the screenshot button, instead of creating "pic 4.png" it will create another "pic 2.png", breaking the sequence of your images.

So my request is for the emulator (while you have it open) to ignore if there's a gap in the numbered images and just keep incrementing the number until you close the emulator.

Once you close it down, this behavior would, of course, reset and when it you load the emulator again, it would will look for the earliest number if you take more screenshots.

If you want a visual example of how this should work, just try the FCEUX emulator. Take 3 screenshots, delete the middle one and take a 4th screenshot and you'll see it doesn't try to fill the gap.

Thanks!

@qwertymodo
Copy link
Collaborator

qwertymodo commented May 27, 2024 via email

@ReyVGM
Copy link
Author

ReyVGM commented May 27, 2024

Perhaps an alternative might be to just ditch sequential numbering in favor of timestamps (or maybe add an option to switch between the two). Then your files would always be in order.

That would work too.

However, if you are going to do it that way, make sure the milliseconds are included in the filename, because sometimes people mash the key multiple times per second to capture things in rapid succession and if you only go as far as seconds, then only one capture per second will happen and not multiple.

@Felipefpl
Copy link
Contributor

I agree with the changes proposed by @ReyVGM 👍

Also, it would be nice if the resolution of the pics were increased. Even when you use filters like 2xBRZ and a big resolution the image is saved with 256x224. It's too small to see them in the Windows Photo Viewer and also when you upscale the pictures in a picture mode like we see on Nexus Mods the quality of the picture is decreased because of the resolution, we see jagged borders around the characters, it's nothing like what we see in-game with the filter enabled.

@bearoso
Copy link
Collaborator

bearoso commented Sep 11, 2024

If you want to take a screenshot with all the filters applied, use your operating system screenshot function. The builtin one is intended to get the raw data, which would be tedious to do with an outside screenshot tool.

If you need to take screenshots at millisecond increments, use the frame stepping key. If you need it that often, try a desktop streaming tool.

@bearoso bearoso changed the title Request: a small screenshot behavior change Request: Save screenshots with timestamp in file name Sep 11, 2024
@bearoso
Copy link
Collaborator

bearoso commented Sep 12, 2024

I've added this. It saves the file with a game-year-month-day-hour:minute:second template. If you hit the screenshot button really fast, it increments the filename with -0, -1, etc. so as to not overwrite anything.

@ReyVGM
Copy link
Author

ReyVGM commented Sep 12, 2024

Excellent, thanks bearoso!

@Felipefpl
Copy link
Contributor

If you want to take a screenshot with all the filters applied, use your operating system screenshot function.

This isnt an option since i take hundreds of pics to choose some selected ones to post in a site, i'd have to quit snes9x every time i wanted to save something. ;)

The builtin one is intended to get the raw data, which would be tedious to do with an outside screenshot tool.

I understand, although i dont understand why this cant be done inside snes9x itself but if it's something hard to do i can see why it's not done.

If you need to take screenshots at millisecond increments, use the frame stepping key. If you need it that often, try a desktop streaming tool.

I searched for the frame stepping key in the input/hotkeys sections but couldnt find it.

@bearoso
Copy link
Collaborator

bearoso commented Sep 12, 2024

I understand, although i dont understand why this cant be done inside snes9x itself but if it's something hard to do i can see why it's not done.

It's prohibitively difficult. Taking an image of the filtered, shaded image means a video memory readback, which has to be implemented by all the output backends. The raw image is just a dump of memory.

If you want resizing, it's better to do it with another program or a batch tool like imagemagick:

for s in *.png; do
    convert $s -resize 200% ${s%.*}-2x.png
done

@ReyVGM
Copy link
Author

ReyVGM commented Sep 13, 2024

This isnt an option since i take hundreds of pics to choose some selected ones to post in a site, i'd have to quit snes9x every time i wanted to save something. ;)

You could always use an external program, there's one called "PrintScreen" that works really well and takes incremental screenshots too.

I searched for the frame stepping key in the input/hotkeys sections but couldnt find it.

input -> customize hotkeys -> frame advance

@Felipefpl
Copy link
Contributor

You could always use an external program, there's one called "PrintScreen" that works really well and takes incremental screenshots too.

I"d rather do this with the emu itself but if it's hard to implement this so i'll go with the external program. :/

I searched for the frame stepping key in the input/hotkeys sections but couldnt find it.

input -> customize hotkeys -> frame advance

Thanks for telling me the correct name of the key. 👍

@Thorarin
Copy link
Contributor

As far as I can tell, the current implementation of this on the master branch breaks the Windows build, due to localtime_r not being available. I tried using localtime_s instead which seems to work, but here it warns about compatibility issues between Microsoft CRT and the C standard, so that's probably not a good solution.

There is a secondary problem as well, in Windows colons (:) are not a valid character in the filename, so attempting to open the file will always fail on Windows.

@bearoso
Copy link
Collaborator

bearoso commented Sep 15, 2024

I didn't even think about the colons. Switched to regular localtime and used dashes instead of the colons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants