somehow-digital / typo3-media-processing

"Media Processing" for TYPO3 integrates various image processing libraries and SaaS cloud services into TYPO3 by leveraging their APIs to process images.
https://somehow.digital
GNU General Public License v3.0
6 stars 1 forks source link

Strange URLs when activating (bunny.net) #12

Closed VilterPD closed 3 months ago

VilterPD commented 3 months ago

Hi dear developers,

the extension is producing strange URLS for me when I activate it, leading to 404 errors for the images:

src="https://cdn.dev.trauminselreisen.de/https:/www.dev.trauminselreisen.de/fileadmin/templates/images/Platzhalter-Bilder/Trauminsel_Reisen_Bedienelemente_8._Reisethemen_2.jpg?width=640"

The origin URL is strangely nested inside. The actual URL should be src="https://cdn.dev.trauminselreisen.de/fileadmin/templates/images/Platzhalter-Bilder/Trauminsel_Reisen_Bedienelemente_8._Reisethemen_2.jpg?width=640"

Which would work. I have also appended the settings I have set, though they are not very numerous

Screenshot 2024-06-06 at 16-04-27 Install Tool on site Trauminselreisen · Trauminselreisen TYPO3 CMS 12 4 10 Screenshot 2024-06-06 at 16-04-35 Install Tool on site Trauminselreisen · Trauminselreisen TYPO3 CMS 12 4 10

thasmo commented 3 months ago

I can't test this right now, but I'd assume the problem occurs somewhere in https://github.com/somehow-digital/typo3-media-processing/blob/main/Classes/UriBuilder/BunnyUriSource.php

thasmo commented 3 months ago

@VilterPD, what happens when you set https://cdn.dev.trauminselreisen.de/ as api_endpoint (Pull Zone URL)?

thasmo commented 3 months ago

@VilterPD, the issue seems to be related to setting config.absRefPrefix to some value other than auto or /, so most likely you're using config.absRefPrefix with a custom domain value. If you can remove this for now, it should prevent the issue.

But this needs a fix on our side.

VilterPD commented 3 months ago

@VilterPD, what happens when you set https://cdn.dev.trauminselreisen.de/ as api_endpoint (Pull Zone URL)?

I get another strange URL

https://cdn.dev.trauminselreisen.de/https:/www.dev.trauminselreisen.de/fileadmin/user_upload/CLI_-_Peninsula_Villa_-_Aerial_6_Trauminsel_Reisen.jpg?width=2048&height=934

VilterPD commented 3 months ago

@VilterPD, the issue seems to be related to setting config.absRefPrefix to some value other than auto or /, so most likely you're using config.absRefPrefix with a custom domain value. If you can remove this for now, it should prevent the issue.

But this needs a fix on our side.

Ill try changing it

thasmo commented 3 months ago

Version 0.5.0 has a fix for this. Thank you for reporting the issue! :)

VilterPD commented 3 months ago

Oh, nice, thanks. Sadly I don't really have access to the parameter directly, but I have asked the other developer to change it to auto. Thanks

thasmo commented 3 months ago

Oh, nice, thanks. Sadly I don't really have access to the parameter directly, but I have asked the other developer to change it to auto. Thanks

FYI: With version 0.5.0 you don't even need to change absRefPrefix.