Reputation: 2146
I have a wpf application and inside using Image resizer as a third party tool in that app. I am trying to achieve the following scenario:
I have text box (Employee Name) for example "Madona"
I have a image text box linked with third party tool "Image Resizer".
If i choose the image (eg: Madona123.jpg
), the Image resizer will generate 17 different size images and drop it in my source folder (e.g. Madona123_80x60.jpg
, Madona123_150x150.jpg
, etc..)
But am trying to change the file name like e.g: Madona_80x60.jpg
, Madona_150x150.jpg
I have two options but not sure which one is effective
Create Temp Dir from the source folder where the image is there and change the name based on the "Employee Name" and pass that image to "Image Resizer" tool
Once the Image is generated in the destination folder,then change the file name.
Am not sure which one is best and what other concerns i have to look ,thanks for your input.
Upvotes: 1
Views: 367
Reputation: 1928
From your suggested scenarios I would go for option 2.
I do agree with Blam's statement that option one would make the base coding a bit more simple but I think aldo the bit of extra work, option 2 will give you less possibility for failure.
So if you're gonna be using it in a manageable environment where you know the setup of your targetmachines, go with option one, it requires less and more straightforward coding, if you're gonna be using it in any other sort of environment, go with option 2. It 'll give you the highest chance of success.
Upvotes: 0
Reputation: 45096
Option 1 has an extra copy command - you can rename when you copy. But with option 2 you have multiple renames. I would do 1 for simplicity.
Upvotes: 2