GithubHelp home page GithubHelp logo

Comments (5)

junuNGT avatar junuNGT commented on July 23, 2024 1

Hi, I think what he meant was he wanted to save the cropped image in a bigger size than the size of the croppicheadercontainer.
Eg: containersize:300x300, savesize: 900x900 after cropping with respect to x and y cordinates
I am also looking for a solution. Thank you :)

from croppic.

felix-penrose avatar felix-penrose commented on July 23, 2024

You can modify the php crop script like so;

here are some post vars;

// original sizes
$img_init_w = $_POST['imgInitW'];
$img_init_h = $_POST['imgInitH'];

Then in the section above the resizing/saving etc;

// lets make a copy of the original first
// ================================================================
$original_img = imagecreatetruecolor($img_init_w, $img_init_h);
imagecopyresampled($original_img, $source_image, 0, 0, 0, 0, $img_init_w, $img_init_h, $img_init_w, $img_init_h);
imagejpeg($original_img, $original_filename.$type, 100);

Note: the variable names are probably different to those in the example code provided for this. The same logic can be applied if you want multiple sizes of the images other than the cropped version too.

from croppic.

sconsult avatar sconsult commented on July 23, 2024

+1 for @Novocaine88 for his anwser

from croppic.

felix-penrose avatar felix-penrose commented on July 23, 2024

That's what my post is doing. It's saving the original image size. I'm on my phone right now so can't post example code, but you could apply the same as above and just change the resolution to what you want.

from croppic.

junuNGT avatar junuNGT commented on July 23, 2024

@Novocaine88 im not able to get it to work, please post a sample code if possible. also i am not looking to save original image, i want to save a cropped version of the image but the final resolution must be larger than the croppic container.
Thank you

from croppic.

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.