Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit 66725da

Browse files
v3.1.0 Feat: multithreading
1 parent f19561b commit 66725da

7 files changed

Lines changed: 30 additions & 72 deletions

File tree

Among-Us-Dumpy-Gif-Maker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Based off of: https://daveparrish.net/posts/2019-11-16-Better-AppImage-PKGBUILD-template.html
33

44
_pkgname="among-us-dumpy-gif-maker"
5-
_pkgver="3.0.1"
5+
_pkgver="3.1.0"
66
_jar="Among-Us-Dumpy-Gif-Maker-${_pkgver}-all.jar"
77

88
pkgname="${_pkgname}"

PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Based off of: https://daveparrish.net/posts/2019-11-16-Better-AppImage-PKGBUILD-template.html
33

44
_pkgname="among-us-dumpy-gif-maker"
5-
_pkgver="3.0.1"
5+
_pkgver="3.1.0"
66
_jar="Among-Us-Dumpy-Gif-Maker-${_pkgver}-all.jar"
77

88
pkgname="${_pkgname}"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
### Please credit this repository when you use this program!
29-
##### Current version: 3.0.1
29+
##### Current version: 3.1.0
3030

3131
# Instructions
3232

@@ -50,13 +50,13 @@
5050

5151
To everyone else:
5252

53-
### Make sure to [download the jar](https://github.com/ThatOneCalculator/Among-Us-Dumpy-Gif-Maker/releases/download/v3.0.1/Among-Us-Dumpy-Gif-Maker-3.0.1-all.jar)!
53+
### Make sure to [download the jar](https://github.com/ThatOneCalculator/Among-Us-Dumpy-Gif-Maker/releases/download/v3.1.0/Among-Us-Dumpy-Gif-Maker-3.1.0-all.jar)!
5454

5555
### Basic usage:
5656
Click and open the jar, select the file, and a file called "dumpy.gif" will be made in the same folder as the jar.
5757

5858
### CLI usage:
59-
- `java -jar Among-Us-Dumpy-Gif-Maker-3.0.1-all.jar <flags>`
59+
- `java -jar Among-Us-Dumpy-Gif-Maker-3.1.0-all.jar <flags>`
6060
All flags are optional.
6161
Flags:
6262
```
@@ -75,5 +75,5 @@ git clone https://github.com/ThatOneCalculator/Among-Us-Dumpy-Gif-Maker
7575
cd Among-Us-Dumpy-Gif-Maker
7676
gradle wrapper
7777
./gradlew shadowJar # .\gradelw.bat shadowJar if you're on Windows
78-
java -jar ./build/libs/Among-Us-Dumpy-Gif-Maker-3.0.1-all.jar
78+
java -jar ./build/libs/Among-Us-Dumpy-Gif-Maker-3.1.0-all.jar
7979
```

among-us-dumpy-gif-maker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
/usr/bin/java -jar /usr/lib/Among-Us-Dumpy-Gif-Maker-3.0.1-all.jar $@
3+
/usr/bin/java -jar /usr/lib/Among-Us-Dumpy-Gif-Maker-3.1.0-all.jar $@

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
statcordkey = lines[0].strip()
4444

4545
upsince = datetime.datetime.now()
46-
version = "3.0.1"
46+
version = "3.1.0"
4747

4848
intents = discord.Intents.default()
4949
bot = commands.AutoShardedBot(command_prefix=commands.when_mentioned_or("!!"), intents=intents, chunk_guilds_at_startup=False)

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "dev.t1c.amogus"
8-
version = "3.0.1"
8+
version = "3.1.0"
99

1010
repositories {
1111
mavenCentral()

src/main/java/dev/t1c/dumpy/sus.java

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ public static void main(String[] args) throws Exception {
6969

7070
Options options = new Options();
7171

72-
Option li = Option.builder().longOpt("lines").hasArg().desc("Changes the number of lines (defaults to 10)").build();
72+
Option li = Option.builder().longOpt("lines").hasArg().desc("Changes the number of lines (defaults to 10)")
73+
.build();
7374
Option fl = Option.builder().longOpt("file").hasArg().desc("Path to file, hides file picker").build();
7475
Option bk = Option.builder().longOpt("background").hasArg().desc("Path to custom background").build();
75-
Option md = Option.builder().longOpt("mode").hasArg().desc("Crewmade mode, currently supports default and furry").build();
76+
Option md = Option.builder().longOpt("mode").hasArg()
77+
.desc("Crewmade mode, currently supports default and furry").build();
7678
Option eo = Option.builder().longOpt("extraoutput").hasArg().desc("Appends text to output files").build();
7779
Option hp = Option.builder().longOpt("help").desc("Shows this message").build();
7880
options.addOption(li);
@@ -166,21 +168,31 @@ public static void main(String[] args) throws Exception {
166168
CountDownLatch l = new CountDownLatch(frames.length);
167169
for (int index = 0; index < frames.length; index++) {
168170
final int indexx = index;
171+
// "Finalized series" of variables. To fix "final or effectively final" errors.
172+
final BufferedImage F_bg = bg;
173+
final int F_ty = ty;
174+
final int F_tx = tx;
175+
final String F_modestring = modestring;
176+
final int F_count1Check = count1Check;
177+
final int F_count2Reset = count2Reset;
178+
final String F_dotSlash = dotSlash;
179+
final String F_extraoutput = extraoutput;
180+
// Start of new thread
169181
new Thread(() -> {
170182
try {
171183
// bg
172-
frames[indexx] = toBufferedImage(bg.getScaledInstance(ix, iy, Image.SCALE_SMOOTH));
184+
frames[indexx] = toBufferedImage(F_bg.getScaledInstance(ix, iy, Image.SCALE_SMOOTH));
173185

174186
// counts. One for iterating across frames and the other for the line reset
175187
int count = indexx;
176188
int count2 = indexx;
177189

178190
// iterates through pixels
179-
for (int y = 0; y < ty; y++) {
180-
for (int x = 0; x < tx; x++) {
191+
for (int y = 0; y < F_ty; y++) {
192+
for (int x = 0; x < F_tx; x++) {
181193

182194
// Grabs appropriate pixel frame
183-
var pixelI = main.getResource("dumpy/" + count + modestring + ".png");
195+
var pixelI = main.getResource("dumpy/" + count + F_modestring + ".png");
184196
BufferedImage pixel = ImageIO.read(pixelI);
185197
pixel = shader(pixel, image.getRGB(x, y));
186198
// overlays it (if not null)
@@ -190,56 +202,19 @@ public static void main(String[] args) throws Exception {
190202

191203
// Handles animating
192204
count++;
193-
if (count == count1Check) {
205+
if (count == F_count1Check) {
194206
count = 0;
195207
}
196208
}
197209
// Handles line resets
198210
count2--;
199211
if (count2 == -1) {
200-
count2 = count2Reset;
212+
count2 = F_count2Reset;
201213
}
202214
count = count2;
203-
final int indexx = index;
204-
// "Finalized series" of variables. To fix "final or effectively final" errors.
205-
final BufferedImage F_bg = bg;
206-
final int F_ty = ty;
207-
final int F_tx = tx;
208-
final String F_modestring = modestring;
209-
final int F_count1Check = count1Check;
210-
final int F_count2Reset = count2Reset;
211-
final String F_dotSlash = dotSlash;
212-
final String F_extraoutput = extraoutput;
213-
// Start of new thread
214-
new Thread(()->{
215-
try {
216-
// bg
217-
frames[indexx] = toBufferedImage(F_bg.getScaledInstance(ix, iy, Image.SCALE_SMOOTH));
218-
219-
// counts. One for iterating across frames and the other for the line reset
220-
int count = indexx;
221-
int count2 = indexx;
222-
223-
// iterates through pixels
224-
for (int y = 0; y < F_ty; y++) {
225-
for (int x = 0; x < F_tx; x++) {
226-
227-
// Grabs appropriate pixel frame
228-
var pixelI = main.getResource("dumpy/" + count + F_modestring + ".png");
229-
BufferedImage pixel = ImageIO.read(pixelI);
230-
pixel = shader(pixel, image.getRGB(x, y));
231-
// overlays it (if not null)
232-
if (pixel != null) {
233-
frames[indexx] = overlayImages(frames[indexx], pixel, (x * 74) + pad, (y * 63) + pad);
234-
}
235-
236-
// Handles animating
237-
count++;
238-
if (count == F_count1Check) {
239-
count = 0;
240215
}
241216
// Writes finished frames
242-
ImageIO.write(frames[indexx], "PNG", new File(dotSlash + "F_" + indexx + extraoutput + ".png"));
217+
ImageIO.write(frames[indexx], "PNG", new File(F_dotSlash + "F_" + indexx + F_extraoutput + ".png"));
243218

244219
// Gives an idea of progress
245220
System.out.println(indexx);
@@ -248,23 +223,6 @@ public static void main(String[] args) throws Exception {
248223
e.printStackTrace();
249224
}
250225
}).start();
251-
// Handles line resets
252-
count2--;
253-
if (count2 == -1) {
254-
count2 = F_count2Reset;
255-
}
256-
count = count2;
257-
}
258-
// Writes finished frames
259-
ImageIO.write(frames[indexx], "PNG", new File(F_dotSlash + "F_" + indexx + F_extraoutput + ".png"));
260-
261-
// Gives an idea of progress
262-
System.out.println(indexx);
263-
l.countDown();
264-
} catch (Exception e) {
265-
e.printStackTrace();
266-
}
267-
}).start();
268226
}
269227
l.await();
270228
// Sets output file name

0 commit comments

Comments
 (0)