[-] UlrikHD@programming.dev 0 points 5 months ago

Reminder that our Code of Conduct (3.2, 3. 5) applies even on communities outside our instance. If you keep breaking those rules we may give you a temporary ban.

[-] UlrikHD@programming.dev 1 points 2 years ago* (last edited 2 years ago)

if Valve isn't selling at a loss to poorer regions then they are simply extracting additional profit from higher-income regions on the assumption that those customers can afford it.

Valve can't sell for a loss the same way ebay can't. Valve simply takes a percentage of the price everytime a game is bought, publishers are in complete control of the price they want to sell. Often, publishers will let Steam automatically set regional pricing based e.g. the American price though.

The way these publishers operate, they will simply set the price at the highest possible value to extract as much as money ad they can from those willing to spend 60+$. Those unwilling or incapable of spending that amount of money, will just buy the game later on a sale. Price skimming has only become more and more prevalent in PC gaming with steam being the "innovator" of frequent sales.

[-] UlrikHD@programming.dev 1 points 2 years ago

You can, but you may need to edit some registers to avoid windows reseting them.

[-] UlrikHD@programming.dev 1 points 2 years ago

Aren't people notified when mods removes their stuff?

[-] UlrikHD@programming.dev 1 points 2 years ago

Interesting stuff, might give me an excuse to look into rust in the future. Thanks!

[-] UlrikHD@programming.dev 1 points 2 years ago* (last edited 2 years ago)

As others have suggested, ffmpeg is a great cli tool. If you aren't comfortable with the terminal you can do it via python like this:

import os
import sys
import subprocess


def crop_media(file_name: str, w: int, h: int, x: int, y: int, new_dir: str) -> None:
    try:
        subprocess.run(f'ffmpeg -i "{file_name}" -vf "crop={w}:{h}:{x}:{y}" temp.gif -y',
                           shell=True, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        os.rename('temp.gif', os.path.join(new_dir, file_name))
    # Print the error and continue with other gifs, remove try block if you want a complete stop
    except subprocess.CalledProcessError as e:
        print(e)
    except KeyboardInterrupt:
        print('KeyboardInterrupt, cleaning up files...')
        os.remove('temp.gif')
        sys.exit(0)


def crop_directory(directory: str, w: int, h: int, x: int, y: int, new_dir: str) -> None:
    for root, _, files in directory:
        for file in files:
            if not file.endswith('.gif'):
                continue
            if os.path.isfile(os.path.join(new_dir, file)):
                print(f'{file} already exists in {new_dir}, skipping...')
                continue

            file_path = os.path.normpath(os.path.join(root, file))
            crop_media(file_path, w, h, x, y, new_dir)


if __name__ == '__main__':
    width = 0
    height = 0
    x_offset = 0
    y_offset = 0
    gif_directory = ''
    new_directory = ''
    crop_directory(gif_directory, width, height, x_offset, y_offset, new_directory)

This should go through every file in the directory and subdirectories and call the ffmpeg command on each .gif. With new_directory you can set a directory to store every cropped .gif. The ffmpeg command is based on johnpiers suggestion.

The script assumes unique filenames for each gif and should work with spaces in the filenames. If they aren't unique, you can just remove the new_directory part, but you will then lose the original gif that you cropped.

[-] UlrikHD@programming.dev 1 points 2 years ago

Strange, is there really no report button on lemmy/Jerboa?

[-] UlrikHD@programming.dev 0 points 2 years ago

~~flair~~ Instance checks out.

[-] UlrikHD@programming.dev 1 points 2 years ago

Except that you have to know exactly what is, character for character, and usually includes some long string of numbers and letters where 1 character is wrong and you have to retype the whole damn thing. This is the opposite of easy.

If it a program you are unfamiliar with, yes you'll probably need to search for the apt name and copy paste. I much prefer that over searching a website, verifying it's not a scam site, then download the exe, and then run the exe once the download is finished. After the first time, just add it to a .sh script and then you can download every program you need automatically if you ever need to set up a new instance again.

I guess it's not for all, but worst case it's hardly any more work than needing to go to a website to download the exe.

view more: ‹ prev next ›

UlrikHD

joined 2 years ago
MODERATOR OF