muraduk Posted July 19, 2010 Posted July 19, 2010 Hi, i am using the images held on a dropshippers website... When i have created a website and uploaded all products via 'Easy Populate' The image do not display as the url for them has added the domain name of the website in front e.g www.mydomain.com/images/http://www.XXXXXXX.com/images/aaabbbccc.jpg how do i get it that the URL of the images are the url provided by the dropshipper?? In admin it is the correct link... hope someone can help.. Thanks in advance
MrPhil Posted July 19, 2010 Posted July 19, 2010 There's something wrong/corrupted with the image file. Bring up the page that's supposed to display the image. View > Page source and look at the code (or right click on the place where the image should be, if it shows a "broken image" icon, and look at the Properties). See what image (path and name) the page is trying to display. Bring up that image directly in your browser. If you can't display it, the image was corrupted somehow. Try uploading it again to the server, this time being careful to use "BINARY" transfer mode. Also, if a JPEG image, make sure it's RGB color model, not CMYK -- not all browsers can display CMYK. If your page is requesting a wrong image, determine if the file name is wrong, if the path is wrong, or both. We can go from there. If the image is stored in the database with http://their site/their path/file name, does it show up as that in the page display, or has http://your site/ been added to the front? It shouldn't have been, but I don't know for sure if osC is smart enough to deal with images on other sites.
muraduk Posted July 19, 2010 Author Posted July 19, 2010 Hi, no corruption... if you look at my site www.jungle2jungle.co.uk right click the images and the properties the URL is incorrect e.g somehow it has added the domain name and images folder before the actual URL of the image the image ia at hxxp://www.atssitecentre.co.uk/images/products/20000/20255f.jpg But the URL is showing as hxxp://jungle2jungle.co.uk/images/http://www.atssitecentre.co.uk/images/products/20000/20255f.jpg The hxxp://jungle2jungle.co.uk/images/ is being added on Where and how is this been added on ? as the admin page is correct URL Thanks...
MrPhil Posted July 19, 2010 Posted July 19, 2010 OK, I can see in the page that the image is src="images/http://theothersite...", so you need to figure out who is molesting the original URL ("http://theothersite...") by adding images/ in front of it. Can you go into phpMyAdmin and take a careful look at what's stored in the product image file name field? If it's images/http://theothersite..., then that means that EasyPopulate isn't working right (doesn't realize that the URL is already complete). In that case, I would post on the EasyPopulate discussion. You also might check if there is a NULL or other invisible character in the CSV, just before the http:, which fools EasyPopulate or osC into thinking that the URL does not start with http://. There's always the possibility that EasyPopulate doesn't think to look for a leading http:// or https://, and just slaps on the image directory. On the other hand, if it's stored in the database as http://theothersite..., it sounds like EasyPopulate is working OK and the problem is in osC. Can you manually create a product with an image URL that starts with http://, and does osC leave it alone? One way or the other, it's possible that EasyPopulate or osC isn't recognizing that the URL given is already complete, and should not have the image directory added to it. Once you find who's at fault, the fix should be easy enough -- just check if the product image URL starts with http:// or https://, and if so, don't prepend the image directory. Does EasyPopulate try to load the image into your server, or does it realize that it's external and is to be left there? You might be getting errors logged somewhere if it's trying to copy over the images to local storage -- can you confirm that it's not trying to copy them, or if it is, whether it's getting errors or is successful? P.S. You have a whole bunch of links <a href=http://jungleto... You should have <a href="http://...". That could be causing confusion in some browsers.
muraduk Posted July 19, 2010 Author Posted July 19, 2010 From Forum: http://www.oscommerce.com/forums/topic/355558-product-images-from-url-no-local/page__gopid__1521286entry1521286 ================================================================================ You can have both local and remote images at the same time. External images are not supported because your server and images location are prefixed to the image name, so if you use Easy Populate to import your items with the url set to something like 'http://remote.server.ip.address/image.name', this is prefixed inside the function tep_image. This can be rectified by editing /catalog/includes/functions/html_output.php Find the following:- //// // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { return false; } Add immediately after:- // check to see if image is external or internal (check for http) and modify $src if ( substr($src,strlen(DIR_WS_IMAGES),4) == 'http') { $src = substr($src,(strlen(DIR_WS_IMAGES))); } This will check to see if the first 4 characters of the filename are 'http' if they are it will re-write the variable $src to remove the local server url and images directory, allowing OSCommerce to download the image from the remote server; this will cause additional traffic to the remote server so be sure you have permission to do this. ============================================================================== Now have a look... the Properties URL is correct.... but still cannot get the image to be seen... i'll keep you updated if any progress... Thanks..
MrPhil Posted July 19, 2010 Posted July 19, 2010 Hmm. OK, it sounds like DIR_WS_IMAGES = 'images/' is prepended to the source anyway. Then for EasyPopulate, you add a few lines to see if the original source started with http, and if so, strip off DIR_WS_IMAGES, hopefully leaving the URL (in $src) starting with http://... // check to see if image is external or internal (check for http) and modify $src if ( substr($src,strlen(DIR_WS_IMAGES),4) == 'http') { DIR_WS_IMAGES should be 'images/', so strlen is 7, substr($src,7,4) should be 'http' (if it originally started with http) $src = substr($src,(strlen(DIR_WS_IMAGES))); strlen is 7, so substr($src,7) should be everything 'http' and later } If you put the code in the right place, it ought to be stripping 'images/' off the URL, leaving http://othersite... Have you confirmed that DIR_WS_IMAGES is 'images/' in both configure.php files? Just to check, the resulting code in html_output.php should be //// // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { return false; } // check to see if image is external or internal (check for http) and modify $src if ( substr($src,strlen(DIR_WS_IMAGES),4) == 'http') { $src = substr($src,(strlen(DIR_WS_IMAGES))); } // alt is added to the img tag even if it is null to prevent browsers from outputting // the image filename as default Is that what you have in both your html_output.php files? I would assume that at least the includes/functions/ version needs to be changed, and probably the admin/includes/functions/ too.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.