Giter Club home page Giter Club logo

Comments (6)

Zulko avatar Zulko commented on May 16, 2024

This was a bug, I just fixed it on github and pypi. Tell me if it works !

from moviepy.

oxivanisher avatar oxivanisher commented on May 16, 2024

I will tell you as soon as i can. Probably in about 12 hours.

from moviepy.

Zulko avatar Zulko commented on May 16, 2024

Yeah sure, no hurry, have a nice day :)

from moviepy.

oxivanisher avatar oxivanisher commented on May 16, 2024

It works like a charm! Thank you very much 💃

from moviepy.

tburrows13 avatar tburrows13 commented on May 16, 2024

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

from moviepy.

oxivanisher avatar oxivanisher commented on May 16, 2024

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 :)

from moviepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.