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

Load image with original aspect ratio and sorter one image to multiple categories #1

Open
ahbon123 opened this issue Aug 3, 2019 · 5 comments

Comments

@ahbon123
Copy link

ahbon123 commented Aug 3, 2019

Hello Nestak2:

Thanks for sharing this project which is quite useful. Anyway after using locally this project, I would like to make two proposals for you:

First, I think it would be better if we can load images with original aspect ratio.
This is my code, if you want, you can use:

    @staticmethod
    def _load_image(path):
        """
        Loads and resizes an image from a given path using the Pillow library
        :param path: Path to image
        :param size: Size of display image
        :return: Resized image
        """
        max_height = 700 
        img = Image.open(path)
        s = img.size
        ratio = max_height / s[1]
        image = img.resize((int(s[0]*ratio), int(s[1]*ratio)), Image.ANTIALIAS)
        return image

Second, I hope to realize a function which can sorter or copy one image into multiple folders, could you please make this function and update on Github? Thanks a lot.

@Nestak2
Copy link
Owner

Nestak2 commented Aug 3, 2019

Hi ahbon123,
I am happy to read the code is useful for you! I will implement your presented function def _load_image(path) in the next days, as soon as I have the time for that.

Regarding your second suggestion: I must admit that my skills with tkinter are really poor, I just changed by trial and error the original project image-sorter by Christian Baumgartner. If I have time in 2 or 3 months maybe I will look into making the change you suggest, but else I encourage you to make any adjustments you like and I can then add you as a contributor and we will just include your version into the repository :) Or you can also publish the changes in a new repository on your own.

Sorry that I can't help out more for now, have fun with the code!

@ahbon123
Copy link
Author

ahbon123 commented Aug 3, 2019

I'll try, if I have any progress, I'll let you know. Thanks anyway.

Nestak2 added a commit that referenced this issue Mar 27, 2020
This commit resolves issue #1
@Nestak2
Copy link
Owner

Nestak2 commented Mar 27, 2020

It looks like @aman17ashray (thanks!) has included a resizing option as a boolean variable at the beginning of the script. I'll keep the issue open, though, since we don't have yet an option to include an image into multiple categories.

@ghost
Copy link

ghost commented Mar 27, 2020

Hi, Can you please elaborate what you meant by

an option to include an image into multiple categories.

@Nestak2
Copy link
Owner

Nestak2 commented Mar 27, 2020

@aman17ashray In the post by abhon123 above he asks for

a function which can sorter or copy one image into multiple folders

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

2 participants