!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/lampp/share/docs/   drwxr-xr-x
Free 14.43 GB of 61.93 GB (23.3%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     crop.c (1.31 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* $Id$ */

#include "gd.h"
#include <stdio.h>
#include <stdlib.h>

void save_png(gdImagePtr im, const char *filename)
{
    FILE *fp;
    fp = fopen(filename, "wb");
    if (!fp) {
        fprintf(stderr, "Can't save png image %s\n", filename);
        return;
    }
#ifdef HAVE_LIBPNG
    gdImagePng(im, fp);
#else
    printf("No PNG support. Cannot save image.\n");
#endif
    fclose(fp);
}

gdImagePtr read_png(const char *filename)
{
    FILE * fp;
    gdImagePtr im;

    fp = fopen(filename, "rb");
    if (!fp) {
        fprintf(stderr, "Can't read png image %s\n", filename);
        return NULL;
    }
#ifdef HAVE_LIBPNG
    im = gdImageCreateFromPng(fp);
#else
    im = NULL;
    printf("No PNG support. Cannot read image.\n");
#endif
    fclose(fp);
    return im;
}

int main()
{
    gdImagePtr im, im2;

    im = gdImageCreateTrueColor(400, 400);

    if (!im) {
        fprintf(stderr, "Can't create 400x400 TC image\n");
        return 1;
    }

    gdImageFilledRectangle(im, 19, 29, 390, 390, 0xFFFFFF);
    gdImageRectangle(im, 19, 29, 390, 390, 0xFF0000);
    save_png(im, "a1.png");

    im2 = gdImageCropAuto(im, GD_CROP_SIDES);
    if (im2) {
        save_png(im2, "a2.png");
        gdImageDestroy(im2);
    }
    gdImageDestroy(im);

    im = read_png("test_crop_threshold.png");
    if (!im) {
        return 1;
    }

    im2 = gdImageCropThreshold(im, 0xFFFFFF, 0.6);
    if (im2) {
        save_png(im2, "a4.png");
        gdImageDestroy(im2);
    }

    gdImageDestroy(im);
    return 0;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.6101 ]--