Exemplo n.º 1
0
def inspect(workspace):    
    variants = get_variants(workspace, 'doc', exclude=['thumbnail', 'preview'])
    output_variants = get_variants(workspace, 'image', auto_generated = True)
    media_types = get_ext_by_type('image')
#    source_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = False)]
#    output_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = True, hidden = False)]
     
   
    return {
        'name': __name__,
       
        
        'params':[
            {   
                'name': 'source_variant_name',
                'fieldLabel': 'Input Rendition',
                'xtype': 'multiselect',     
                'value': ['edited', 'original'],                           
                'description': 'input-variant',
                
                'help': ''
            },
            
            {   
                'name': 'output_variant_name',
                'fieldLabel': 'Output Rendition',
                'xtype': 'rendition_select',
                #'values': output_variants,
                #'value': output_variants[0],
                'description': 'output-variant',
                'default': 0,
                'help': ''
            },
            {
             'xtype': 'numberfield',
             'name': 'max_size',
             'fieldLabel': 'Max size',
             'value': 300,
             'width':200
             },
             
             {   
                'name': 'output_extension',
                'fieldLabel': 'Output format',
                'xtype': 'select',
                'values': media_types,
                'description': 'output_extension',
                'value': '.jpg',
                'help': ''
            }
             
            
            ]
             
                                    
    } 
Exemplo n.º 2
0
def inspect(workspace):
    variants = get_variants(workspace, 'doc', exclude=['thumbnail', 'preview'])
    output_variants = get_variants(workspace, 'image', auto_generated=True)
    media_types = get_ext_by_type('image')
    #    source_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = False)]
    #    output_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = True, hidden = False)]

    return {
        'name':
        __name__,
        'params': [
            {
                'name': 'source_variant_name',
                'fieldLabel': 'Input Rendition',
                'xtype': 'multiselect',
                'value': ['edited', 'original'],
                'description': 'input-variant',
                'help': ''
            },
            {
                'name': 'output_variant_name',
                'fieldLabel': 'Output Rendition',
                'xtype': 'rendition_select',
                #'values': output_variants,
                #'value': output_variants[0],
                'description': 'output-variant',
                'default': 0,
                'help': ''
            },
            {
                'xtype': 'numberfield',
                'name': 'max_size',
                'fieldLabel': 'Max size',
                'value': 300,
                'width': 200
            },
            {
                'name': 'output_extension',
                'fieldLabel': 'Output format',
                'xtype': 'select',
                'values': media_types,
                'description': 'output_extension',
                'value': '.jpg',
                'help': ''
            }
        ]
    }
Exemplo n.º 3
0
def inspect(workspace):
    from django.db.models import Q
    media_types = get_ext_by_type('image')
    #source_variants = get_variants(workspace, 'video', exclude= ['thumbnail'])
    #output_variants = get_variants(workspace, 'image', auto_generated=True)
    return {
        'name': __name__,
        'params':[
            {   
                'name': 'source_variant_name',
                'fieldLabel': 'Input Rendition',
                'xtype': 'multiselect',
                'value': ['edited', 'original'],
                #'values': source_variants,
                #'value': [source_variants[1], source_variants[0]],
                'description': 'input-variant',
                'help': ''
            },
            
            {   
                'name': 'output_variant_name',
                'fieldLabel': 'Output Rendition',
                'xtype': 'rendition_select',
                #'values': output_variants,
                
                'description': 'output-variant',
                'default': 0,
                'help': ''
            },             
            {
                'xtype':'numberfield',
                'name': 'frame_w',
                'fieldLabel': 'frame width',                    
                'description': 'width of the extracted frame',
                'minValue':10,
#                    'value': 100,
                'help': 'width of the extracted image in pixels (aspect ratio is preserved)'
            },
            {
                'xtype':'numberfield',
                'name': 'frame_h',
                'fieldLabel': 'frame height',                    
                'description': 'height of the extracted frame',
                'minValue':10,
#                    'value': 100,
                'help': 'height of the extracted image in pixels (aspect ratio is preserved)'
            },
            {
                'xtype':'numberfield',
                'name': 'position',
                'fieldLabel': 'position',                    
                'description': 'position of frame',
                'minValue':10,
#                    'value': 100,
                'help': 'position of frame to extract as percentage of total time'
            },
            {   
                'name': 'output_extension',
                'fieldLabel': 'Output format',
                'xtype': 'select',
                'values': media_types,
                'description': 'output_extension',
                'value': '.jpg',
                'help': ''
            },
        ],
    } 
Exemplo n.º 4
0
def inspect(workspace):
   
    media_types = get_ext_by_type('image')
    variants = get_variants(workspace, 'image')
    
    #output_variants = get_variants(workspace, 'image', auto_generated = True)
#    source_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = False)]
#    output_variants = [[variant.name] for variant in Variant.objects.filter(Q(workspace = workspace) | Q(workspace__isnull = True), auto_generated = True, hidden = False)]
     
    return {
        'name': __name__,
        
        'params':[
            {   
                'name': 'source_variant_name',
                'fieldLabel': 'Input Rendition',
                'xtype': 'multiselect',
                'media_type': 'image',
                'value': ['edited', 'original'],
                'description': 'input-variant',
                
                'help': ''
            },
            
            {   
                'name': 'output_variant_name',
                'fieldLabel': 'Output Rendition',
                'xtype': 'rendition_select',
                #'values': output_variants,
                #'value': output_variants[0],
                'description': 'output-variant',
                'default': 0,
                'help': ''
            },
            {
             'xtype':'fieldsetcontainer',
             'order_field_name': 'actions',
             'items':[{
              'xtype': 'movablecbfieldset',
              'title': 'Resize',
              'name': 'resize',
              'order_field_name': 'actions',
              'order_field_value': 'resize',
            
             
              'items':[{
                    'xtype':'numberfield',
                    'name': 'resize_h',
                    'fieldLabel': 'height',                    
                    'description': 'height',
                    'minValue':0,
#                    'value': 100,
                    'help': 'height of resized image in pixels'
                },
                {
                    'xtype':'numberfield',
                    'name': 'resize_w',
                    'fieldLabel': 'width',                    
                    'description': 'width',
#                    'value': 100,
                    'minValue':0,
                    'help': 'width of resized image in pixels'
                },
                
              ]
              },
               {
              'xtype': 'movablecbfieldset',
              'title': 'Crop',
              'name': 'crop',
             
              'order_field_name': 'actions',
              'order_field_value': 'crop',
              'items':[{
                    'xtype':'numberfield',
                    'name': 'crop_h',
                    'fieldLabel': 'height',                    
                    'description': 'height',
                    'minValue':0,
#                    'value': 100,
                    'help': 'heigth of crop area, default till bottom edge of image'
                },
                {
                    'xtype':'numberfield',
                    'name': 'crop_w',
                    'fieldLabel': 'width',                    
                    'description': 'width',
#                    'value': 100,
                    'minValue':0,
                    'help': 'width of crop area, default till right edge of image'
                },
                
                
              ]
              },
               {
              'xtype': 'movablecbfieldset',
              'title': 'Rotate',
              'name': 'rotate',              
              'order_field_name': 'actions',
              'order_field_value': 'rotate', 
              'items':[{
                    'xtype':'combo',
                    'name': 'rotation', # this name must be the same as the name of the parameter passed to run method !
                    'allowBlank': 'false',
                    'autoSelect': 'true',
                    'width': 50,
                    'editable':'false',
                    'triggerAction':'all',
                    'lazyRender':'true',
                    'forceSelection':'true',
                    'fieldLabel': 'rotation',                    
                    'store':['0', '+90','-90'],
                    'mode':'local',
                    'description': '90 degree clockwise/counterclockwise rotation',
                    'help': 'performs a 90 degree clockwise/counterclockwise rotation'
                },
                
                
              ]
              },




              {
              'xtype': 'watermarkfieldset',
              'title': 'Watermark',
              'name': 'watermark',
              'order_field_name': 'actions',
              'order_field_value': 'watermark',                            
               'renditions': variants
              },
              ]
             
             },
                         

              
              {   
                'name': 'output_extension',
                'fieldLabel': 'Output Format',
                'xtype': 'select',
                'values': media_types,
                'description': 'output_extension',
                'value': '.jpg',
                'help': ''
            }
              
        ]
        
    } 
Exemplo n.º 5
0
def inspect(workspace):
    from django.db.models import Q
    media_types = get_ext_by_type('image')
    #source_variants = get_variants(workspace, 'video', exclude= ['thumbnail'])
    #output_variants = get_variants(workspace, 'image', auto_generated=True)
    return {
        'name':
        __name__,
        'params': [
            {
                'name': 'source_variant_name',
                'fieldLabel': 'Input Rendition',
                'xtype': 'multiselect',
                'value': ['edited', 'original'],
                #'values': source_variants,
                #'value': [source_variants[1], source_variants[0]],
                'description': 'input-variant',
                'help': ''
            },
            {
                'name': 'output_variant_name',
                'fieldLabel': 'Output Rendition',
                'xtype': 'rendition_select',
                #'values': output_variants,
                'description': 'output-variant',
                'default': 0,
                'help': ''
            },
            {
                'xtype':
                'numberfield',
                'name':
                'frame_w',
                'fieldLabel':
                'frame width',
                'description':
                'width of the extracted frame',
                'minValue':
                10,
                #                    'value': 100,
                'help':
                'width of the extracted image in pixels (aspect ratio is preserved)'
            },
            {
                'xtype':
                'numberfield',
                'name':
                'frame_h',
                'fieldLabel':
                'frame height',
                'description':
                'height of the extracted frame',
                'minValue':
                10,
                #                    'value': 100,
                'help':
                'height of the extracted image in pixels (aspect ratio is preserved)'
            },
            {
                'xtype': 'numberfield',
                'name': 'position',
                'fieldLabel': 'position',
                'description': 'position of frame',
                'minValue': 10,
                #                    'value': 100,
                'help':
                'position of frame to extract as percentage of total time'
            },
            {
                'name': 'output_extension',
                'fieldLabel': 'Output format',
                'xtype': 'select',
                'values': media_types,
                'description': 'output_extension',
                'value': '.jpg',
                'help': ''
            },
        ],
    }