Atakku / lpg

9 stars 5 forks source link

How to use this [Tutorial] #4

Open VXsz opened 8 months ago

VXsz commented 8 months ago

Prepare to put effort into your inside jokes. I've never used rust before so somethings will be vague, but I've managed to get it running.

Step 1:

Step 2:

Step 6:

You can also grab it here as I did compile it, no virus %100 free download [Will post link once I get permission from repo author]

How it works you might ask? I had to figure it out from the code just like you

Basically, you make a folder beside the exe called "input", go inside the folder and paste all the pics inside, once that's done all you have to do now is run it and it will start doing it's thing and output to a folder called... output, in this process you won't get any activity inside the cmd shell that opens so there are no indicators of anything happeing, but it's processing images. To find the images, go down to LethalPosters/Paintings (just click thru the folders, it's trying to emulate how it works inside modpacks) and you will find all the images inside each respective folder and all of them were generated, it generates only upto 15 images of random combos (afaict) but you probably change the limit inside the code and re-compile, but the size will increase with it as each image can take from 700kb to 1.2mb and it will buildup fast.

danilio8 commented 8 months ago

Hi, great guide to help people understand this. I want to add something small as I've had a problem trying to run thingy.exe. If thingy.exe immediatly closes after opening it, that means that there is an error in main.rs. In my case it could not find the input file where you put in the images to be cropped. To fix it, open main.rs in visual studio (code) and change the string in line 6 from "./input" to the directory where your images are stored. NB: windows will use the \ when copying an adres from file explorer; change this to / instead otherwise it will not work.

justonedog101 commented 2 months ago

This tutorial was a life saver for someone who doesn't know squat about coding. One thing that wasn't mentioned though is that you have to put all the template images in the same folder as thingy.exe.

ShadowRocks2 commented 3 weeks ago

heads up, if you get a linker error, when installing build tools select Desktop development with C++

Masabouli commented 2 weeks ago

Hello, I have an error in step 6

The compiled program in target/debug called thingy.exe have an error

thread 'main' panicked at src/main.rs:7:10: called Result::unwrap() on an Err value: Os { code: 3, kind: NotFound, message: "Le chemin d’accès spécifié est introuvable." } stack backtrace: 0: 0x7ff7eebe12dd - std::backtrace_rs::backtrace::dbghelp64::trace at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src....\backtrace\src\backtrace\dbghelp64.rs:91 1: 0x7ff7eebe12dd - std::backtrace_rs::backtrace::trace_unsynchronized at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src....\backtrace\src\backtrace\mod.rs:66 2: 0x7ff7eebe12dd - std::sys_common::backtrace::_print_fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:68 3: 0x7ff7eebe12dd - std::sys_common::backtrace::_print::impl$0::fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:44 4: 0x7ff7eebf7019 - core::fmt::rt::Argument::fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\fmt\rt.rs:165 5: 0x7ff7eebf7019 - core::fmt::write at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\fmt\mod.rs:1168 6: 0x7ff7eebddf81 - std::io::Write::write_fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\io\mod.rs:1835 7: 0x7ff7eebe10b6 - std::sys_common::backtrace::print at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:34 8: 0x7ff7eebe2fa8 - std::panicking::default_hook::closure$1 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:271 9: 0x7ff7eebe2c56 - std::panicking::default_hook at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:298 10: 0x7ff7eebe34d8 - std::panicking::rust_panic_with_hook at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:795 11: 0x7ff7eebe3397 - std::panicking::begin_panic_handler::closure$0 at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:664 12: 0x7ff7eebe19cf - std::sys_common::backtrace::rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$> at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\sys_common\backtrace.rs:171 13: 0x7ff7eebe3048 - std::panicking::begin_panic_handler at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652 14: 0x7ff7eebfed44 - core::panicking::panic_fmt at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72 15: 0x7ff7eebff2a0 - core::result::unwrap_failed at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\result.rs:1679 16: 0x7ff7ee786c88 - enum2$<core::result::Result<std::fs::ReadDir,std::io::error::Error> >::unwrap at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\result.rs:1102 17: 0x7ff7ee786c88 - thingy::main at C:\Users\Eliott\lpg\src\main.rs:6 18: 0x7ff7ee78478b - core::ops::function::FnOnce::call_once<void (*)(),tuple$<> > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\ops\function.rs:250 19: 0x7ff7ee78681e - core::hint::black_box at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\hint.rs:338 20: 0x7ff7ee78681e - std::sys_common::backtrace::rust_begin_short_backtrace<void (*)(),tuple$<> > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\sys_common\backtrace.rs:155 21: 0x7ff7ee787e41 - std::rt::lang_start::closure$0<tuple$<> > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\rt.rs:159 22: 0x7ff7eebda2ee - std::rt::lang_start_internal at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\rt.rs:141 23: 0x7ff7ee787e1a - std::rt::lang_start<tuple$<> > at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\std\src\rt.rs:158 24: 0x7ff7ee787dd9 - main 25: 0x7ff7eebfcba0 - invoke_main at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 26: 0x7ff7eebfcba0 - __scrt_common_main_seh at D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 27: 0x7ffedc747374 - BaseThreadInitThunk 28: 0x7ffede45cc91 - RtlUserThreadStart error: process didn't exit successfully: target\debug\thingy.exe (exit code: 101)