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

prepare_image() and prepare_video() wrong defaults max_size for story upload #10

Open
3 tasks done
b3nab opened this issue Apr 6, 2019 · 0 comments
Open
3 tasks done

Comments

@b3nab
Copy link

b3nab commented Apr 6, 2019

Before submitting this issue I have:

  • Updated to the lastest version v0.3.8
  • Read the README
  • Searched the bugtracker for similar issues including closed ones

Describe the Bug/Error:

It was referenced on b3nab/instapy-cli#37

I think that there is the need for a minimal change in media.py file or specify a new variable for the max_size parameter in media.prepare_image() and media.prepare_video() to mimic MediaRatios.reel and MediaRatios.standard.
At the moment an image with a good ratio, 1080:1920 is 0.5625, but it's resized because of the default max_size params has been set to (1080, 1350), instead it should be at least (1080, 1920) to support instagram stories.

Paste the output of python -V here:
Python 3.7.1
Code:

# Example code that will produce the error reported
from instagram_web_api_extensions import media

img_path = 'image-story.jpg'e
ratio = MediaRatios.reel
print('ratio is: ', ratio)
image_data, image_size = media.prepare_image(img_path, aspect_ratios=ratio)
print('image size: {} with ratio of: {}'.format(image_size, image_size[0]/image_size[1]))

Error/Debug Log:

ratio is: (0.5625, 0.75)
image size: (759, 1350) with ratio of: 0.5622222222222222

So what are your suggestions, create a new variable like MediaRatios to configure properly the size when prepare a media? Or just change that max_size=(1080, 1350) to a better max_size=(1080, 1920)?

However, thanks for your work ! :)

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

1 participant