resize of folder selecting specific files
Posted: 2017-04-28T23:19:55-07:00
Hi, wow just want to say what a great resource.
I wonder if you can help
Hello,
We have a program which embeds files uploaded from tablets used by our trainers and creates a word document with the embeded files in it.
All has worked fine with no problems until recently when we started to upgrade our tablets used and started using new tablets which have 8mp camera not 5mp on the older tablet models.
The problem being the result bmp files the program creates from jpg files uploaded from the tablets increases the file size from 3mb per picture to 23mb per picture with resolutions being 3264x2448 and 1440x864 respectively. This is a problem
So what i am looking for is if this program/code can on upload of the evidence as a folder containing lots of different evidence files run through the files and identify all the jpg files over a certain memory size or resolution size (whichever is easier) and reduces the size of these files replacing the original files and then to allow the software to carry on and do its thing on the new resized images.
so
1- Folder of File gets Upload to our server from the trainers tablets
2- Your software reduces size of all jpg files for pictures taken to about 800x480 maintaining size ratios and not distorting pictures, my thought was to take whatever the biggest dimension is and reduce this to 800 and by working out the other dimension by dividing larger dimension by small dimension of original we get the original ratio so in case of 8mb 3264x2448 is 1.333 there reduced file would be 800x 600 but on 5mp camera it would be 800x480 (In the folder are other files audio, video and also jpg thumb nails we don't want the thunbnail pictures resizing or other files just the bigger jpg pictures– so maybe have logic to select on size over a value or file memory size so not to change thumb nail jpg’s these are small and typically a few KB in size)
3- Make sure the original files are replaced with new reduced size with aspect ratio maintained and file names etc maintained(critical)
I would like some simple way to set size for largest size ie set at 800 for now but would want you to have a parameter - reduction size - 800 which i can change as and when to test different sizes and see resultant output filesize when our other software converts to bmp file
Also a snipit of code or api to call your routine so we can add this to the current software and fire up your software as needed in the process - so for clarity you code does the job it is a independent routine that on inserting or calling the routine will run your code on a specific folder as specified by our current software.
Here is a link to a example folder that we would want to reduce all the jpg images that are not thumbnails
https://www.dropbox.com/sh/quqzhcefrywe ... WGkIa?dl=0
the above is from a tablet using 8mp camera
https://www.dropbox.com/s/viyu3mtzwy10n ... 6.zip?dl=0
the above is from a tablet using a 5mp camera so you can see difference on jpg images we want as specified all images to be resize to 800 for largest dimension and other dimension resized in line with the aspect ratio of the origional image it is resizing from. Thus all images irrespective of what tablet is used have the same sized (800) image for the largest dimension.
To summerise :
Our Trainers hit upload button on their tablets and vis sftp a zipped folder is sent to a folder 'upload' on our windows 2012 server.
What i would like is for on detection of a new zipped folder uploaded to the upload folder from our trainers tablets for the magik code to resise all the jpg files that are not thumbnails to 800 (from largest dimension on origional file) and maintain the aspect ratio for other dimension and critically retaining file name and then our other software to start. Can this be done
Our server is windows server2012 R2
Thank you
I wonder if you can help
Hello,
We have a program which embeds files uploaded from tablets used by our trainers and creates a word document with the embeded files in it.
All has worked fine with no problems until recently when we started to upgrade our tablets used and started using new tablets which have 8mp camera not 5mp on the older tablet models.
The problem being the result bmp files the program creates from jpg files uploaded from the tablets increases the file size from 3mb per picture to 23mb per picture with resolutions being 3264x2448 and 1440x864 respectively. This is a problem
So what i am looking for is if this program/code can on upload of the evidence as a folder containing lots of different evidence files run through the files and identify all the jpg files over a certain memory size or resolution size (whichever is easier) and reduces the size of these files replacing the original files and then to allow the software to carry on and do its thing on the new resized images.
so
1- Folder of File gets Upload to our server from the trainers tablets
2- Your software reduces size of all jpg files for pictures taken to about 800x480 maintaining size ratios and not distorting pictures, my thought was to take whatever the biggest dimension is and reduce this to 800 and by working out the other dimension by dividing larger dimension by small dimension of original we get the original ratio so in case of 8mb 3264x2448 is 1.333 there reduced file would be 800x 600 but on 5mp camera it would be 800x480 (In the folder are other files audio, video and also jpg thumb nails we don't want the thunbnail pictures resizing or other files just the bigger jpg pictures– so maybe have logic to select on size over a value or file memory size so not to change thumb nail jpg’s these are small and typically a few KB in size)
3- Make sure the original files are replaced with new reduced size with aspect ratio maintained and file names etc maintained(critical)
I would like some simple way to set size for largest size ie set at 800 for now but would want you to have a parameter - reduction size - 800 which i can change as and when to test different sizes and see resultant output filesize when our other software converts to bmp file
Also a snipit of code or api to call your routine so we can add this to the current software and fire up your software as needed in the process - so for clarity you code does the job it is a independent routine that on inserting or calling the routine will run your code on a specific folder as specified by our current software.
Here is a link to a example folder that we would want to reduce all the jpg images that are not thumbnails
https://www.dropbox.com/sh/quqzhcefrywe ... WGkIa?dl=0
the above is from a tablet using 8mp camera
https://www.dropbox.com/s/viyu3mtzwy10n ... 6.zip?dl=0
the above is from a tablet using a 5mp camera so you can see difference on jpg images we want as specified all images to be resize to 800 for largest dimension and other dimension resized in line with the aspect ratio of the origional image it is resizing from. Thus all images irrespective of what tablet is used have the same sized (800) image for the largest dimension.
To summerise :
Our Trainers hit upload button on their tablets and vis sftp a zipped folder is sent to a folder 'upload' on our windows 2012 server.
What i would like is for on detection of a new zipped folder uploaded to the upload folder from our trainers tablets for the magik code to resise all the jpg files that are not thumbnails to 800 (from largest dimension on origional file) and maintain the aspect ratio for other dimension and critically retaining file name and then our other software to start. Can this be done
Our server is windows server2012 R2
Thank you