Code Monkey home page Code Monkey logo

Comments (6)

claviska avatar claviska commented on August 21, 2024

That exact code worked for me. I suspect that you haven't hard-coded your filenames, so do a var_dump() to see what's actually getting passed to the save() method—if unset, it defaults to the original file.

from simpleimage.

jackthebeast avatar jackthebeast commented on August 21, 2024

tried to do a var_dump() but seems to be the correct value passed to save(), i've also tried to pass the arguments from GET but i get the same result.
i've this code now:
include "lib/SimpleImage.php";

$img = new abeautifulsite\SimpleImage($_GET["path_source"]);
$img->rotate(90);
var_dump($_GET["path_dest"]);
$img->save(var_dump($_GET["path_dest"]));

both var_dump() say the variables contain "img/b.jpg"

how can i solve?

from simpleimage.

jackthebeast avatar jackthebeast commented on August 21, 2024

thanks to Yann Sagon on Stackoverflow i've found out that that syntax:

$filename = $filename ?: $this->filename;

(used in the library) is not supported by my version of php (5.4.7)

changed it to:

if($filename==null){
$filename=$this->filename;
}

from simpleimage.

claviska avatar claviska commented on August 21, 2024

Thanks for pointing that out. I'll update the source to use standard ternary operators instead of shortcuts.

On Sep 24, 2013, at 9:44 AM, jackthebeast [email protected] wrote:

thanks to Yann Sagon on Stackoverflow i've found out that that syntax:

$filename = $filename ?: $this->filename;

(used in the library) is not supported by my version of php (5.4.7)

changed it to:

if($filename==null){
$filename=$this->filename;
}


Reply to this email directly or view it on GitHub.

from simpleimage.

claviska avatar claviska commented on August 21, 2024

The ternary shorthand is supported in PHP 5.3+. Are you sure you're on 5.4.7?

from simpleimage.

jackthebeast avatar jackthebeast commented on August 21, 2024

at least this is what phpinfo() says...

from simpleimage.

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.