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

When pushing an update, update existing images where there's a difference #6

Open
samuel-emrys opened this issue May 23, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@samuel-emrys
Copy link
Owner

The current design means that if an image already exists on the wordpress site, it won't be update. This excludes the possibility of updating an image without manually deleting it first. Introduce the logic required to do a diff between the existing image size and the target image size to determine if it should be uploaded. A naive implementation would be to download every image and do a comparison:

import requests
response = requests.get(image_url)
existing_image_size = len(response.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant