Replace all images in folder with another image but keep filename

why is there 431 copies of the same image lol
Because the system works on unique file names but the image needed to be the same, so the system renamed each image - not sure why you needed to know this? Can you help?
 
Upvote 0
Will you ever need to repeat the process?

I would create 431 symbolic links to one copy of the image file.

Then, if you ever need to repeat the process all you have to do is replace the image file.
 
Upvote 0
I'm not a programmer so I wouldn't know how to do that, can you help?


In this case, just make a CSV file container the image you want to copy 431 times in the first column and the target filename(s) in the second column. Should be a doddle in Excel, particularly if the filenames are regular.

Or, even easier, repeat the copy command 431 times, save it as a .bat file and execute.

COPY C:\newimage.jpg D:\images\1.jpg
COPY C:\newimage.jpg D:\images\2.jpg
COPY C:\newimage.jpg D:\images\3.jpg

etc.
 
Upvote 0
Because the system works on unique file names but the image needed to be the same, so the system renamed each image - not sure why you needed to know this? Can you help?
Because that is a fundamental data issue.

As said above, create a text file and repeat the lines as mentioned, ie:

COPY C:\newimage.jpg D:\images\1.jpg
COPY C:\newimage.jpg D:\images\2.jpg
COPY C:\newimage.jpg D:\images\3.jpg

Then rename the file from "yourfile.txt" to "yourfile.bat" (Assuming this is a windows machine?). then run the file in CMD.

Make sure you have "show file extensions" turned on in windows so you can rename the .txt to .bat.
 
Upvote 0
Will you ever need to repeat the process?

I would create 431 symbolic links to one copy of the image file.

Then, if you ever need to repeat the process all you have to do is replace the image file.
This is something I need to do in a windows folder
 
Upvote 0
And if you need a list of files in a directory, open a command prompt (Start Menu > Run.. > cmd) and put:

C:\
CD imagefolder
DIR *.jpg > filenames.txt

Replace drive/folder names with your own. That will generate a text file with the list of files matching the extension.
 
Upvote 0
Had to read the opening post twice to understand the problem.

The only practical solution is to save the new image with the existing file name then duplicate and rename 431 times. A script will speed up the process but you may need to pay someone to do this.

Or ask on a freelancer site and they can do it for you for a few dollars.

What’s not clear is how the files are named. Is it for example a sequence or are they all totally different.
 
Upvote 0
Ahhh! I feel the pain!
 
  • Haha
Reactions: HFE Signs
Upvote 0
Long winded, manually replaced!
If this task is going to come up again, you would do well to restructure things so you have one image file and 431 differently named symlinks to it.

Then to change you just need to overwrite the image file with the new one. Job done, and repeatable as many times as you like.
 
Upvote 0
If you had sent me a list of files, I would have knocked you up a script. It would have only taken a 2-3 minutes.
I would have happily paid, had you of offered at the start - if I need this again, I'll give you a shout
 
Upvote 0
If anyone can make me a simple little program that automatically does it.

A box with the new image file (box A)
A box with the current list of files
A go button!

And a list of the new files, all with the same names but containing the image from box A

Who can do this and how much would you charge?
 
Upvote 0
I would have happily paid, had you of offered at the start - if I need this again, I'll give you a shout

Nah, I wouldn't have charged you, it's not like it's a big job. I was waiting for your reply to my last message to see if you needed help but you never responded, so I assumed you had found a solution.
 
Upvote 0
If anyone can make me a simple little program that automatically does it.

A box with the new image file (box A)
A box with the current list of files
A go button!

And a list of the new files, all with the same names but containing the image from box A

Who can do this and how much would you charge?

From memory, I think this will do it:

Been a while since I used it, and I haven't used the latest version.

If not, I'll take a look this evening.
 
Upvote 0
From memory, I think this will do it:

Been a while since I used it, and I haven't used the latest version.

If not, I'll take a look this evening.
I've had a quick look, I don't think it will do it but I'll have a closer look later, thanks
 
Upvote 0
Another question for you website guys if you don't mind...

The folder on our webserver called /webroot/files/img_cache/ can this be emptied? It has thousands of files and I'm wondering if its slowing down the server?
 
Upvote 0
Another question for you website guys if you don't mind...

The folder on our webserver called /webroot/files/img_cache/ can this be emptied? It has thousands of files and I'm wondering if its slowing down the server?
If you have access to the server, any folder can be emptied. Just make sure you know, what the consequences might be! Take a backup first.
 
Upvote 0
Another question for you website guys if you don't mind...

The folder on our webserver called /webroot/files/img_cache/ can this be emptied? It has thousands of files and I'm wondering if its slowing down the server?
Only if that folder is being accessed. Look at the names and dates of the files. If they are ancient the likelihood it's part of an old configuration. If you have newer files then it could be you have server caching enabled (for faster file access).

Rename the folder and see if your site still works. If not change it back.
 
Upvote 0

Latest Articles