image manipulation, resize adn unique name |
[eluser]the_unforgiven[/eluser]
Hi guys, I currently have this code which uploads fine to the server folder in the config but i need to resize it them place into thumbs folder with a unqiue name, so can someone adviose how and best way to do it based on my code please? Code: function _do_upload_file()
[eluser]the_unforgiven[/eluser]
Can anyone help me based on what I have put already??
[eluser]NotDior[/eluser]
Looks like the function write_file() might help you out. http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]the_unforgiven[/eluser]
write_file() helper not what i was after. I have this code Code: function _do_upload_file() Which currently uploads files to assets/uploads/userfiles/imagename.jpg for example but now the code above should resize the image uploaded adn then place into a folder called thumbs inside assets/uploads/userfiles/thumbs for instance is what I have setup, can any one help me on this? Have I missed something or done something wrong?
[eluser]NotDior[/eluser]
Did you check the permission on your thumbs folder to make sure it's writeable? The code looks good to me on the surface.
[eluser]the_unforgiven[/eluser]
All files are local on Mac and all have read write permissions, it uploads but doesn't re-size and then put into thumbs folder so obviously there's something not right within the code I'm not sure of.
[eluser]LynxCoder[/eluser]
[quote author="the_unforgiven" date="1334245310"] Which currently uploads files to assets/uploads/userfiles/imagename.jpg for example but now the code above should resize the image uploaded adn then place into a folder called thumbs inside assets/uploads/userfiles/thumbs for instance is what I have setup, can any one help me on this? Have I missed something or done something wrong?[/quote] Ok, well just to confirm, the file is uploading ok - but not resizing or giving a unique name? Does the code provide any error messages? Have you tried echoing the value of $config['source_image'] to check that its providing the correct URL? Ah - just realised one thing the UserGuide for Image Manipulation says $config['new_image'] provides the name and path, your only providing the path - so is the resized file being created in the $this->gallery_path directory and called 'thumbs'. If not, it could be that if the directory exists, the file system will not allow a file to have the same name as a directory, without an extension. Try adding a temporary file name ... Code: 'new_image' => $this->gallery_path . '/thumbs/itworks.jpg', Rich
[eluser]the_unforgiven[/eluser]
Yes it uploads but does not resize correct! $config[‘source_image’] not tried but will try now! I'll also try Code: 'new_image' => $this->gallery_path . '/thumbs/itworks.jpg', |
Welcome Guest, Not a member yet? Register Sign In |