photo rename and resize
photo rename and resize
i wanna resize photos to save my disk space and rename files with entered data with form is there easy way or code for this.
Re: photo rename and resize
which file i have to edit before upload? help please
Re: photo rename and resize
This is an abstract from the code in the generated "categories_dml.php" file from the Northwind demo (at http://bigprof.com/demo):
This code is responsible for handling the uploaded image and then creating thumbnails for it. You could resize the uploaded image by modifying the code to read:
The second line in the modified code above resizes the uploaded image to fit in a 750x750 box (retaining the aspect ratio with no distortion) .. I haven't tested this modification, so give it a try and let me know if it doesn't work.
Code: Select all
$data['Picture'] = PrepareUploadedFile('Picture', 204800,'jpg|jpeg|gif|png', false, '');
if($data['Picture']) createThumbnail($data['Picture'], getThumbnailSpecs('categories', 'Picture', 'tv'));
if($data['Picture']) createThumbnail($data['Picture'], getThumbnailSpecs('categories', 'Picture', 'dv'));
Code: Select all
$data['Picture'] = PrepareUploadedFile('Picture', 204800,'jpg|jpeg|gif|png', false, '');
if($data['Picture']) createThumbnail($data['Picture'], array('width' => 750, 'height' => 750, 'identifier' => ''));
if($data['Picture']) createThumbnail($data['Picture'], getThumbnailSpecs('categories', 'Picture', 'tv'));
if($data['Picture']) createThumbnail($data['Picture'], getThumbnailSpecs('categories', 'Picture', 'dv'));
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: photo rename and resize
it's not effect original uploaded file,still same resolution,
also i add " ini_set('memory_limit', '128m')" to thumbnail.php and form_view.php now i can see resized thumbnails but still lack of resizing original pics.
also i add " ini_set('memory_limit', '128m')" to thumbnail.php and form_view.php now i can see resized thumbnails but still lack of resizing original pics.
Re: photo rename and resize
i try to implement https://github.com/blueimp/jQuery-File-Upload for resizing pictures before uploading but my knowledge not enough to finish it.
i need some samples about it. any help please ?
i need some samples about it. any help please ?
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: photo rename and resize
Sorry to dredge this old topic back up, but I'd also be very interested to get this working. Spent a bit of time on it today, couldn't get the example to work - adding;
if($data['Picture']) createThumbnail($data['Picture'], array('width' => 750, 'height' => 750, 'identifier' => ''));
Replacing the relevant fields with my own particulars. It still uploaded the file at the original size, unfortunately.
Would appreciate your input!
if($data['Picture']) createThumbnail($data['Picture'], array('width' => 750, 'height' => 750, 'identifier' => ''));
Replacing the relevant fields with my own particulars. It still uploaded the file at the original size, unfortunately.
Would appreciate your input!
-
- Veteran Member
- Posts: 67
- Joined: 2015-06-06 12:10
Re: photo rename and resize
I sidestepped my issue by modifying the image links to open in a new tab, rather than the light box. The need to resize becomes less of an issue.
Will revisit this functionality in the future though.
Will revisit this functionality in the future though.