Comments (6)
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.
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.
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.
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.
The ternary shorthand is supported in PHP 5.3+. Are you sure you're on 5.4.7?
from simpleimage.
at least this is what phpinfo() says...
from simpleimage.
Related Issues (20)
- A feature to fit image in a fixed canvas size with blur background of original image. HOT 2
- Auto fit in square and use source image as background.
- resize function does not check size values HOT 2
- Can not add a text on image HOT 2
- PNG to JPG is possible to change transparent background color? HOT 2
- Background color for text HOT 7
- How to different font file & size, but in an equal position with center align HOT 3
- PHP 8.2: Deprecation warning "Creation of dynamic property"
- Implicit conversion from float 50.800000000000004 to int loses precision HOT 2
- Imagick magick support HOT 1
- Bump `thephpleague/color-extractor` to 0.4 in composer.json HOT 1
- Nothing working HOT 1
- Implicit conversion from float to int loses precision HOT 3
- QR Code HOT 1
- getExif(): Return value must be of type ?array, bool returned HOT 1
- Images not destroyed? HOT 1
- Set fixed size for overlay image
- Request: Combine two pictures
- Implicit conversion from float 56.25 to int loses precision HOT 1
- PHP E_WARNING when imagecreatefromstring() is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleimage.