Hi,
You shouldn’t use file names longer than 255 characters. That’s a technical limit which is probably imposed by your web server, hence the issues here.
On my side, I will make sure file names are not exceeding this size. If that happens, Media File Renamer will not do anything to avoid issues.
Thread Starter
bocsek
(@bocsek)
Hi Jordy!
You misunderstood the situation. I don’t give so long filenames. In the example above I provided the following filename to the plugin:
6050281-Nature-T-oszlop-drothalokhoz-es-betekintesvedelmi-keritesekhez-zold-muanyag–H-175-cm.jpg
This is 94 char. The original filename was 6050281.jpg. I’ve added the text “-Nature-T-oszlop-drothalokhoz-es-betekintesvedelmi-keritesekhez-zold-muanyag–H-175-cm” into the input field of the plugin. I refer to this text as $newname to save time reading… 🙂
What I’m observed, is that if there are only the original file, and additionally 4 thumbnails so 5 files, the renamer works well.
For example:
6050281.jpg -> 6050281$newname.jpg ;
6050281-100×100.jpg -> 6050281$newname-100×100.jpg ;
6050281-150×150.jpg -> 6050281$newname-150×150.jpg ;
6050281-300×300.jpg -> 6050281$newname-300×300.jpg ;
6050281-500×500.jpg -> 6050281$newname-500×500.jpg ;
But if there are more than 4 thumbnails, the renamer get tangled up. I show you how:
6050281.jpg -> 6050281$newname.jpg ; OK!
6050281-100×100.jpg -> 6050281$newname-100×100.jpg ; this is OK
6050281-150×150.jpg -> 6050281$newname-150×150.jpg ; this is OK
6050281-300×300.jpg -> 6050281$newname-300×300.jpg ; this is OK
6050281-500×500.jpg -> 6050281$newname-500×500.jpg ; this is OK
6050281-700×700.jpg -> 6050281$newname$newname-700×700.jpg ; NOT_OK!
6050281-800×800.jpg -> 6050281$newname$newname$newname-800×800.jpg ; NOT_OK!
6050281-900×900.jpg -> 6050281$newname$newname$newname$newname-900×900.jpg ; NOT_OK!
The renamer tries to add string $newname 3! times to the filename, that’s why I got the error filename is too long.
On my side, I will make sure file names are not exceeding this size. If that happens, Media File Renamer will not do anything to avoid issues.
This behavior also should be increased, because in such case, the renamer simply stop the renaming procedure, causing broken images, image links in the database.
Do you think your issue is related to this? This one: https://wordpress.org/support/topic/incorrect-thumbnails-names/#post-14137850. If yes, it would be good to stay on that topic over there, and try to find what you guys have in common. It’s a really specific issue it seems.
Thread Starter
bocsek
(@bocsek)
I’ve seen that topic, I think it’s not related, but quite interesting as well.
Additional information for my case:
WordPress version: 5.3.6
WooCommerce version: 3.8.1 (yes, pretty old)
Media File Renamer: 5.1.6
Now I’ve tried to update to 5.1.8, but the issue is still here.
I did a test rename again, I paste the logfile with my comments, hope this brings you closer to the solution.
Original filename: embio_elonyei.png
New filename: embio_elonyei_em-bio.png
The rename field show embio_elonyei.png, and I added “_em-bio” text before the file extension, then hit Rename button.
https://paste.pics/e65ab61ca07134f959cba18e0ece0d39
Jordy, looks to me like this is due to the target file name (minus the extension) containing the original file name.
I am not sure @galbaras, I think the issue was related to something else… it might be also because the server is run on Windows. I haven’t heard issues related to this for a long while though, so it’s definitely something very specific. I couldn’t replicate it unfortunately 🙁
Thread Starter
bocsek
(@bocsek)
The server is running on linux
OS: Linux
Server: Apache/2.4.25 (Debian)
Document Root: /var/www/<removed>/web
PHP
v7.2.26-1+0~20191218.33+debian9~1.gbpb5a34b
GD: 2.2.5
Memory Limit: 256,0 MiB
Max Script Execute Time: N/As
Max Post Size: 8,0 MiB
Max Upload Size: 2,0 MiB
MYSQL
v10.1.37-MariaDB-0+deb9u1
Maximum No. Connections: 151
Maximum Packet Size: 16,0 MiB
Data Disk Usage: 233,2 MiB
Index Disk Usage: 37,2 MiB
If I share with you a fresh install of WP, do you think you would be able to replicate the issue @bocsek?
Thread Starter
bocsek
(@bocsek)
@tigroumeow I can try it.
Hi @bocsek,
Please contact me through here: http://meowapps.com/contact/. If you can replicate that issue for me, I will definitely fix this 🙂