mirror of
https://github.com/Intervention/image.git
synced 2025-08-27 07:44:30 +02:00
adopt new fileinfo after save
This commit is contained in:
@@ -1726,6 +1726,9 @@ class Image
|
|||||||
throw new Exception\ImageNotWritableException("Can't write image data to path [{$path}]");
|
throw new Exception\ImageNotWritableException("Can't write image data to path [{$path}]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set new file info
|
||||||
|
$this->setFileInfoFromPath($path);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1525,17 +1525,29 @@ class ImageTest extends PHPUnit_Framework_Testcase
|
|||||||
$img = $this->getTestImage();
|
$img = $this->getTestImage();
|
||||||
$img->save($save_as);
|
$img->save($save_as);
|
||||||
$this->assertFileExists($save_as);
|
$this->assertFileExists($save_as);
|
||||||
|
$this->assertEquals($img->dirname, 'public');
|
||||||
|
$this->assertEquals($img->basename, 'test2.jpg');
|
||||||
|
$this->assertEquals($img->extension, 'jpg');
|
||||||
|
$this->assertEquals($img->filename, 'test2');
|
||||||
@unlink($save_as);
|
@unlink($save_as);
|
||||||
|
|
||||||
$save_as = 'public/test2.png';
|
$save_as = 'public/test2.png';
|
||||||
$img = $this->getTestImage();
|
$img = $this->getTestImage();
|
||||||
$img->save($save_as, 80);
|
$img->save($save_as, 80);
|
||||||
|
$this->assertEquals($img->dirname, 'public');
|
||||||
|
$this->assertEquals($img->basename, 'test2.png');
|
||||||
|
$this->assertEquals($img->extension, 'png');
|
||||||
|
$this->assertEquals($img->filename, 'test2');
|
||||||
$this->assertFileExists($save_as);
|
$this->assertFileExists($save_as);
|
||||||
@unlink($save_as);
|
@unlink($save_as);
|
||||||
|
|
||||||
$save_as = 'public/test2.jpg';
|
$save_as = 'public/test2.jpg';
|
||||||
$img = $this->getTestImage();
|
$img = $this->getTestImage();
|
||||||
$img->save($save_as, 0);
|
$img->save($save_as, 0);
|
||||||
|
$this->assertEquals($img->dirname, 'public');
|
||||||
|
$this->assertEquals($img->basename, 'test2.jpg');
|
||||||
|
$this->assertEquals($img->extension, 'jpg');
|
||||||
|
$this->assertEquals($img->filename, 'test2');
|
||||||
$this->assertFileExists($save_as);
|
$this->assertFileExists($save_as);
|
||||||
@unlink($save_as);
|
@unlink($save_as);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user