While individual assets can be renamed by using the “Rename” button in the Asset Inspector, DF Studio also provides a number of features for modifying the names of multiple assets in a bulk operation.
Name changes in DF Studio affect the filename of the original uploaded file.
It is possible to modify the names of all images in the current view, or only a selection of images. To open the Rename Images overlay, click the “Rename Images” button from the Project or Collection inspector, or select two or more images and click the “Rename” button in the Asset Inspector.
DF Studio will assign new numbers to all of the specified images, starting with number 1 for the first image when sorted by the existing name. By default, the new names will take the format: image001, with the correct number of zeroes to ensure that the resulting names will sort in the proper order. The filename text (e.g., “image”), starting number, and number of zeroes can all be customized.
Before committing any bulk renaming operation, click the “Preview New Names” button to confirm the expected result. The order in which assets will be renumbered is displayed in the Preview area, and reflects the order in which assets are currently sorted in the proofsheet view. To specify a different sort, use List View to customize the sort before opening the Rename Images overlay.
Clicking the “Rename Images” button will commit the operation. This cannot be undone.
Renaming will take place as a background process, reviewable on the Activity Page. When all files have been renamed, the view will refresh to display the updated filenames.
Find and Replace Portions of Names
In some cases, it is necessary to apply a custom modification to the asset names to achieve the desired result. For example, the following images are sorted by name but that order does not reflect the correct image sequence:
In the list shown above, the “Rename and Renumber All Images” option would rename image1 to image001 and image10 to image002 based on their position when sorted by the current name. In order to sort properly, some of these names will need one zero added before the image number, while others will need two zeroes. DF Studio's Rename Images tool provides the option to use regular expressions to find and replace portions of a name using a pattern. The following example workflow will create the desired result.
1. Open the Rename Images overlay by selecting images and clicking the “Rename” button, as described above.
2. Select “Find and Replace Portions of Names” and check the box for “Use Regular Expression”.
3. Rename all assets with names that include single-digit numbers:
This will rename image1 to image001 and image2 to image002.
4. Click the “Preview New Names” button to verify the expected outcome, then click the “Rename Images” button to commit the changes.
5. Rename the assets that include two-digit numbers in their filenames by repeating the process with the find and replace patterns below, and clicking “Rename Images” again.
That will rename image10, image11, image12 to image010, image011, image012, resulting in the following list:
See below for a brief explanation of the regular expressions from the example workflow. For further information about regular expressions, see Regular Expression Pattern Matching.
In step 3 of the example, the find pattern image(\d)$ asks the system to find filenames that start with the text “image” followed by a single digit. The \d represents a numeric character, and the parentheses surrounding it tell the system to “capture” the enclosed information for use in the replacement step. The $ stands for “end of line” or the end of the filename. In the replace pattern image00$1 the filename is replaced with the text “image00” as specified, followed by the part captured by the find pattern. In the replacement pattern, $1 represents the first captured item from the find step. Multiple items can be captured and used in the replacement step ($1, $2, $3, etc.).
See a detailed explanation in the interactive regular expression tool at regex101.com/r/y5xEJT/1
In step 5, the find pattern searches for “image” followed by (\d\d), which represents two numeric characters. The replace pattern uses the text “image0” since only one zero needs to be added to these filenames, then $1 to specify the 2-digit number from the find pattern.
See a detailed explanation in the interactive regular expression tool at regex101.com/r/xAbRwz/1