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

Tools: Port refraction's bulk compression script to Python #11574

Merged
merged 1 commit into from
Dec 28, 2024

Conversation

TheTechnician27
Copy link
Contributor

Description of Changes

Converts refraction's bulk compression script which was presented as a Windows-only batch file into a cross-platform Python script.

Rationale behind Changes

Makes the tool cross-platform, putting Windows, Linux, and macOS users (freeBSD?) on a more equal footing and allowing us to ship the tool with PCSX2 instead of tucked away in Red's PCloud.

Suggested Testing Steps

Try all 9 options and try them with and without deleting source items as well as different block sizes if compressing. Presently needs tested on all three major OSes, and it may work in freeBSD, but there's no guarantee at all for that. Until it has been properly tested by multiple people, USE THIS IN A CONTROLLED TESTING ENVIRONMENT WITH JUST A FEW FILES WHICH YOU HAVE BACKED UP ELSEWHERE.

tools/bulk_compression.py Outdated Show resolved Hide resolved
tools/bulk_compression.py Outdated Show resolved Hide resolved
@TheTechnician27 TheTechnician27 force-pushed the compressiontools branch 3 times, most recently from 5d7df91 to a93a105 Compare July 17, 2024 18:11
@TheTechnician27 TheTechnician27 requested a review from F0bes July 17, 2024 18:15
bin/utils/bulk_compression.py Outdated Show resolved Hide resolved
@TheTechnician27 TheTechnician27 force-pushed the compressiontools branch 4 times, most recently from cd96ba3 to 77843da Compare July 18, 2024 15:49
@TheTechnician27 TheTechnician27 marked this pull request as draft July 18, 2024 21:25
@TheTechnician27 TheTechnician27 force-pushed the compressiontools branch 4 times, most recently from 1251bfc to 8264626 Compare July 23, 2024 16:09
case _:
print("You definitely should not be here right now.")
sys.exit(1)

Copy link

@fizwidget fizwidget Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve been using createdvd with my games. Just wondering why createraw is used here - is there a benefit, or much of a muchness?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the script before createdvd was an option, but also I find createraw tends to give slightly better compression, from my own tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also they share similar options, createraw has more versatility in the way it has more options like createdvd doesn't have No --unitsize Option:'

Both have the same compression types (default is lzma,zlib,huff,flac).

But with createdvd you can easier give the correct hunksize. Createraw will default to correct one but you can change to whatever for more or less compression.

Generally looking at the options they do have the same compression powers just differently handled with the code logic.

@lightningterror lightningterror added this to the Release 2.4 milestone Oct 30, 2024
@TheTechnician27 TheTechnician27 marked this pull request as ready for review November 29, 2024 03:41
Copy link
Contributor

@Mrlinkwii Mrlinkwii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good ,

Copy link
Member

@F0bes F0bes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option 5 (DVD CHD to CSO) warns about overwriting ISO files.

Copy link
Member

@F0bes F0bes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on WSL.
All of the options appear to do what they are supposed to do. I checked the hash at every stage and everything was completely lossless.

@F0bes F0bes merged commit b01359e into PCSX2:master Dec 28, 2024
12 checks passed
@PCSX2 PCSX2 deleted a comment from kosai-ksdfounder Dec 29, 2024
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

Successfully merging this pull request may close these issues.

9 participants