I would like to redirect the url of my images from my previous website to the new url in my wix site. But I would like to do that automatically (too much images)...through a router hook or something like that I think I can implement it or at least detect the format of my old url like https://www.mydoamain.com/images/root/subfolder/myimage.jpg, and then redirect to the new url from my wix site.
Thus, I uploaded all my old images to the wix media manager, keeping the same folder structure:
<media manager>/legacy/root/subfolder/myimage.jpg.
All I have to do is extract the image path, i.e. root/subfolder/myimage.jpg, from the requested url, and find the wix url for the corresponding image in the media manager, located in <media manager>/legacy/root/subfolder/myimage.jpg
And here I really don't know how to do that....
I need to find a wix image Url from the path in the media manager...
Does anybody know how to do that?
Thanks a lot in advance.
Hi yes this is possible,
Assuming this is the type of url you get from Wix:
"wix:image://v1/656460_7c0826fb3aed4d3f8dd0e39ddcae0ab6~mv2.png"
You can use the code below:
"https://static.wixstatic.com/media/" + imageSrc.split("/")[3] + "/v1/fill/w_128,h_128,al_c/" + ImageTitle + ".png "
And that would convert it to something like this:
"https://static.wixstatic.com/media/656460_7c0826fb3aed4d3f8dd0e39ddcae0ab6~mv2.png/v1/fill/w_128,h_128,al_c/ImageTitle.png"
IMPORTANT NOTE:
ImageSrc = The original WIX image Src
ImageTitle = The title or alt text that will display as the browser title
If the images you are passing doesn't have a fixed width and height, Your only option is to change the fill to fit. Then you can set the image quality by adjusting the width and height. So this:
"https://static.wixstatic.com/media/" + imageSrc.split("/")[3] + "/v1/fit/w_128,h_128,al_c/" + ImageTitle + ".png "
If you're still having problem with how the image is being displayed, you can remove the effect but at a cost of your ability to change the image title. So this:
"https://static.wixstatic.com/media/" + imageSrc.split("/")[3]
Your welcome,
DJ bon26
Yes. I need this too. I have uploaded hundreds of images into Media. I have a collection that has a row for each image. The row includes a field containing the image file name. But to display it in Wix I need the url. There are too many to copy them manually. Is there not a simple way to get the url from the file name programatically?
Hi all, I just implemented a kind of workaround based on:
- a new collection containing my legacy images as one gallery per row - a group redirect
- an http function that:
- queries the collection
- redirects to a wix media url
It is working fine and my legacy images http://www.mysite.com/images/folder1/folder2/image.jpg are redirected to a new wix media url https://static.wixstatic.com/media/e50527_fa26dd116fdf4bf08a5d8fac30f9dc14~mv2.jpg as expected.
But I still have an issue with an HTTP 429 error: too many requests 😒
For example, my legacy images were referenced from a photography forum where I inserted many links to my images in a single thread.
Then, when I display the page, tens of requests are sent to my wix http function, each call requesting the collection.
Only a few (less than 5) images are displayed on the page and I get the error 429 for all the others.
If I remove the collection query in the http-function (query result is hard coded), a bit more images are displayed, but I still have the 429 error.
Does anybody know how to get rid of this limitation and allow many htt-function calls being served in the same time?
Or is there a way to make wix working as a real image server?
It was so simple with my previous joomla site...
Thanks a lot in advance.
In the media manager when you roll over an image you'll see an icon with an ellipsis "..." on the upper right corner. Click on it and and you'll see "Copy URL". Click on that and the image URL will be copied to your computer's clipboard/memory and you'll be able to paste it anywhere
at the point.
Ok I got it here is how it works:
Image source (from media manager):
wix:image://v1/<uri>/<filename>#originWidth=width&originHeight=height
And from the media manager we can copy the URL, which would be the following:
https://static.wixstatic.com/media/<uri>
Works like a charm.
Hope it helps.
Any answer on this? I also need to retrieve image URL with code.
I know it's possible to get it through the Media Manager, but I need to automate the process through code.
I'd highly appreciate a response on this, thanks.
https://www.wix.com/corvid/reference/$w/image
https://www.wix.com/corvid/reference/$w/image/src