[Important!] Оптимизированные изображения: урезается имя файла и не только

68 views
Skip to first unread message

Mr. Andrew

unread,
Apr 5, 2017, 8:59:36 AM4/5/17
to pagespeed-insights-discuss
Это просто критическая проблема! Google PageSpeed позволяет скачать архив с оптимизированными изображениями, но


Во-первых: урезает длинные названия файлов

______Было: 0033513cabcefb9c8895f2885ebcc0a3.6258243240ec5c98e3eb84fa33350636.jpg
Стало вдруг: 0033513cabcefb9c8895f2885ebcc0a3.6258243240ec5c98e3eb84fa.jpg

Как после этого по FTP заменить старые файлы новыми? Переименовывать каждый файл подряд сверяя с оригиналом???



Во-вторых: самопроизвольно меняет сами названия(!) файлов, оставляя только латинские буквы, подчеркивания и точки (A-Za-z_\.), остальное кодирует через urlencode()

 Было: "Photo файл 123+.jpg"
Стало: "Photo_20_xx_xx_xx_xx_20123_yy.jpg"

Как после этого по FTP заменить старые файлы новыми? Переименовывать каждый файл подряд сверяя с оригиналом???



В-третьих: не соблюдает структуру файлов (их вложенность)

Файл на сайте доступен по адресу:__________________ /assets/img/image.jpg
И таким же должен получиться. А он получается таким: /images/image.jpg

Как после этого по FTP заменить старые файлы новыми? Искать все папки, в каждую(!) заходить, смотреть какие файлы оттуда и только потом загружать нужные???


Всё это просто нонсенс, очень прошу исправить хотя бы первые два пункта
Message has been deleted

Mr. Andrew

unread,
Apr 10, 2017, 4:45:25 AM4/10/17
to pagespeed-insights-discuss
Куда мне направить этот запрос?

Rick Steinwand

unread,
Apr 10, 2017, 7:59:11 AM4/10/17
to pagespeed-insights-discuss
You have the correct place, but Google rarely sends replies to this forum.

To be honest, in the years I have monitored this forum I have never seen this error reported before, probably because everyone except you knows it's a bad practice to insert spaces in urls and your's is the worst case I've seen. It's like you created a test case of adding a space everywhere possible. Every editor I know of prompts me to change a space to %20.

You can wait and hope that Google fixes a low priority problem that only you are experiencing or fix your sloppy code and try again.

Mr. Andrew

unread,
Apr 11, 2017, 6:43:10 AM4/11/17
to pagespeed-insights-discuss
It's not low priority, and you say about just one of all three problems. Google must name images as is, has it spaces or not, because all people are unique and can upload files with any unpredictable name. User will upload optimized images on FTP (imagine that optimized images more than 100, so upload it one by one? No, he will use FTP) and imagine what will happen if image-file names will be different! It will cause image duplicates, but image optimization will fails, because files which need optimization not replaced with new, just optimized. And what's the sense in that he downloaded optimized resources in Google PageSpeed?

You said that text editors / file managers are renaming files "file name.jpg" => "file%20name.jpg". You are wrong, because it will be accessed by URI "file%2520name.jpg" that more wronger than if it will be just "file name.jpg" ("file%20name.jpg" from browser), without changes.

Certainly I don't use spaces in file names. But I have work where I do websites for customers. So customers and only customers are responsible for they file names.

And what to do with file name trimming? And with optimized files ierarchy in archive?

понедельник, 10 апреля 2017 г., 14:59:11 UTC+3 пользователь Rick Steinwand написал:
Message has been deleted

Mr. Andrew

unread,
Apr 11, 2017, 6:50:26 AM4/11/17
to pagespeed-insights-discuss



вторник, 11 апреля 2017 г., 13:43:10 UTC+3 пользователь Mr. Andrew написал:
You said that text editors / file managers are renaming files "file name.jpg" => "file%20name.jpg". You are wrong, because it will be accessed by URI "file%2520name.jpg" that more wronger than if it will be just "file name.jpg" ("file%20name.jpg" from browser), without changes.

Certainly I don't use spaces in file names. But I have work where I do websites for customers. So customers and only customers are responsible for they file names.

Mr. Andrew

unread,
Apr 11, 2017, 7:53:59 AM4/11/17
to pagespeed-insights-discuss
I had to write custom PHP script which renaming files:
1. Replacing _ to %
2. urldecode(), so single % symbols are stay as is
3. Replacing back % to _

But there are problem with filenames like "IMG_022+.jpg", which Google renaming to "IMG_022_.jpg" instead of "IMG_022%2B.jpg"

Mr. Andrew

unread,
Apr 29, 2017, 4:31:58 AM4/29/17
to pagespeed-insights-discuss
Yet actual. How to share this topic to developers?

среда, 5 апреля 2017 г., 15:59:36 UTC+3 пользователь Mr. Andrew написал:

Rick Steinwand

unread,
May 1, 2017, 9:14:39 AM5/1/17
to pagespeed-insights-discuss
Google monitors this forum, but rarely replies.

I would hope it gets fixed eventually.

Meanwhile you could try these and see if they have the same issues:


They are very similar to PSI.

Mr. Andrew

unread,
May 22, 2017, 11:07:30 AM5/22/17
to pagespeed-insights-discuss
I watch into MANIFEST file and found all mappings that I need (Google file name => Original file name). So all questions not actual for now :)


среда, 5 апреля 2017 г., 15:59:36 UTC+3 пользователь Mr. Andrew написал:
Это просто критическая проблема! Google PageSpeed позволяет скачать архив с оптимизированными изображениями, но
Reply all
Reply to author
Forward
0 new messages