-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Too stupid to rotate :D #22
Comments
This was a bug, I just fixed it on github and pypi. Tell me if it works ! |
I will tell you as soon as i can. Probably in about 12 hours. |
Yeah sure, no hurry, have a nice day :) |
It works like a charm! Thank you very much 💃 |
I know this a long shot, but @oxivanisher can you tell me where you got your imgData['orientation']? I am trying to find a way for python to automatically find the orientation, and nothing has come up yet. Thanks |
Hi @Gloin1313 It took me some digging to find this 3 year old script, but i did get lucky. I used the following code (just copy & pasted the relevant stuff): from moviepy.editor import *
from PIL import Image as PILImage
from PIL import ExifTags
for filepath in files:
data = []
img = PILImage.open(filepath)
exif = {
ExifTags.TAGS[k]: v
for k, v in img._getexif().items()
if k in ExifTags.TAGS
}
data.append({'path' : filepath,
'camModel' : exif['Model'],
'camMake' : exif['Make'],
'orientation': exif['Orientation'], }) and then further down if imgData['orientation'] == 1:
clip = ImageClip(imgData['path']).resize(height = HEIGHT).set_pos('center').set_start(clipStart).fadein(FADEIN).set_duration(IMGDURATION).crossfadeout(FADEOUT) #, width = WIDTH
else:
clip = vfx.rotation(ImageClip(imgData['path']).resize(width = HEIGHT).set_pos('center').set_start(clipStart).fadein(FADEIN).set_duration(IMGDURATION).crossfadeout(FADEOUT), 90) Hopefully this helps :) |
Hi all
I really love this project. It helps me with a problem i have since three years and my sister finally will have a wedding video and not only photos. But now i am facing a problem.
I try to rotate the Images which are somehow not rotated from ffmpeg. The EXIF rotation tag allows me to detect if the image is "wrong", so that is not a problem. But i don't know how to use rotation correctly. Here is my test code:
I tried around and fiddled with it, but did not get behind how to do this correctly. Finally all these images are put into a list (clips) and rendered over another background video. This video rendering here is just for testing purposes.
The error output i get is:
Can you give me a hint how to do this right?
Thanks and have a nice day. :)
gn8 from switzerland
The text was updated successfully, but these errors were encountered: