Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)

        def scale_from_metadata(metadata):
    try:
        height = metadata.get('height', None)
        width = metadata.get('width', None)
    except (ValueError, AttributeError):
        return None, None
    return height, width
        


src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/events.py   collective.flowplayer(Download)
from collective.flowplayer.interfaces import IMediaInfo, IAudio, IVideo
from collective.flowplayer.metadata_extraction import parse_raw
from collective.flowplayer.metadata_extraction import scale_from_metadata
 
from Products.ATContentTypes import interface
            try:
                metadata = parse_raw(handle)
                height, width = scale_from_metadata(metadata)
                handle.close()
            except StreamError:

src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/dexterity.py   collective.flowplayer(Download)
from collective.flowplayer.events import AUDIO_EXTENSIONS
from collective.flowplayer.metadata_extraction import parse_raw
from collective.flowplayer.metadata_extraction import scale_from_metadata
from collective.flowplayer.interfaces import IMediaInfo
 
        f = info.value.open()
        metadata = parse_raw(f)
        height, width = scale_from_metadata(metadata)
        anno[MEDIA_INFO_KEY] = dict(audio_only=False, width=width, height=height)
        f.close()

src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/tests/test_metadata_profiling.py   collective.flowplayer(Download)
        metadata = metaex.parse_raw(file_handle)
        file_handle.close()
        assert((288, 360) == metaex.scale_from_metadata(metadata))
        print ' (parse with metadata_extraction: {0:0.6f})'.format(
            time.time() - tt)