Pagina 1 di 2
problema con nome file immagine prodotto
Inviato: 19/11/2008, 0:06
da shop155
salve a tutti
ho un versione di os commerce 2-2 ms2
il mio problemino è che tutte le volte che carico on line una foto(foto.jpp) ad esempio metto un nuovo prodotto e quindi carico la foto
la realativa foto nella cartella image non ha il nome foto.jpg ma un nome alfanumerico tipo 4829406fc26a6e042439ea146f71e264.jpg
come mai?
ai fini del posizionamente è negativo
ma anche quando devo fare una ricerca io personalmente delle foto caricare.
esiste qualche cosa che devo sbloccare per far si che la foto non cambi nome?
resto in attesa
grazie
Re: problema con nome file immagine prodotto
Inviato: 22/11/2008, 1:40
da shop155
nessuno sa aiutarmi?
Re: problema con nome file immagine prodotto
Inviato: 23/11/2008, 5:29
da vampire
Ciao,
io non ti so aiutare....ma cmq ai fini del posizionamento è molto importante il seo-url non il nome delle immagini

Re: problema con nome file immagine prodotto
Inviato: 23/11/2008, 14:09
da lavoriamopervoi
shop155 ha scritto:nessuno sa aiutarmi?
usi qualche contribution per rimpicciolire le immagini?
Re: problema con nome file immagine prodotto
Inviato: 23/11/2008, 16:50
da shop155
credo che ci sia qualche contribuition attiva per rimpicciolire le immagini
ma non so in quanto vedo solo che la stessa immagine è chiamata small , medium , large e thumb...
vi viene in mente qualcosa?
Re: problema con nome file immagine prodotto
Inviato: 23/11/2008, 16:51
da shop155
se ci fosse questa contribution come si chiama?
como posso fare per non farle cambiare il nome alle immagini?
Re: problema con nome file immagine prodotto
Inviato: 23/11/2008, 21:24
da lavoriamopervoi
shop155 ha scritto:se ci fosse questa contribution come si chiama?
como posso fare per non farle cambiare il nome alle immagini?
questo dipende appunto dalla contribution installata...
posta la funzione tep_image()...
presente in includes/functions/html_output.php
per vedere di cosa si tratta...
Ciao
Antonello
Re: problema con nome file immagine prodotto
Inviato: 24/11/2008, 13:11
da shop155
eccola.fatemi sapere come posso fare o modificare questa funzione affinche' non mi cambi piu' il nome.grazieeee
Codice: Seleziona tutto
function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', $image_format_type = 'small', $absurl = false) {
if (empty($src)) {
return false;
}
if (!(strpos($src,'http://') === false)) {
$substring_lengt = strlen($src) - strlen(DIR_WS_IMAGES);
$src = substr($src, -$substring_lengt);
$image = '<img src="' . $src . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) {
$image .= ' title=" ' . tep_output_string($alt) . ' "';
}
if (tep_not_null($width)) {
$image .= ' width="' . tep_output_string($width) . '"';
}
if (tep_not_null($height)) {
$image .= ' height="' . tep_output_string($height) . '"';
}
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
$image .= '>';
return $image;
} else {
//Get file info
$pathinfo_array = pathinfo($src);
$file_name = $pathinfo_array['basename'];
$file_extension = $pathinfo_array['extension'];
//Set $file_ws_path for images files
$file_ws_path = $pathinfo_array['dirname'];
if (substr($file_ws_path, -1) != '/') $file_ws_path .= '/';
//Set $file_fs_path for images files
if (substr($file_ws_path, 0, 1) == '/') {
$file_fs_path = DIR_FS_CATALOG . substr($file_ws_path, strlen(DIR_WS_CATALOG));
} else {
$file_fs_path = DIR_FS_CATALOG . $file_ws_path ;
}
$image_ws_path = $file_ws_path . $file_name;
$image_fs_path = $file_fs_path . $file_name;
if (($file_fs_path == DIR_FS_CATALOG_IMAGES) || ($file_fs_path == DIR_FS_CATALOG_IMAGES_EXTRA)) {
$file_name_prefix = substr($file_name, 0, -(strlen($file_extension) + 1));
switch ($image_format_type) {
case 'thumb':
$resize_image_ws_path = $file_ws_path . $file_name_prefix . '_thumb' . '.' . $file_extension;
$resize_image_fs_path = $file_fs_path . $file_name_prefix . '_thumb' . '.' . $file_extension;
break;
case 'small':
$resize_image_ws_path = $file_ws_path . $file_name_prefix . '_small' . '.' . $file_extension;
$resize_image_fs_path = $file_fs_path . $file_name_prefix . '_small' . '.' . $file_extension;
break;
case 'medium':
$resize_image_ws_path = $file_ws_path . $file_name_prefix . '_medium' . '.' . $file_extension;
$resize_image_fs_path = $file_fs_path . $file_name_prefix . '_medium' . '.' . $file_extension;
break;
case 'large':
$resize_image_ws_path = $file_ws_path . $file_name_prefix . '_large' . '.' . $file_extension;
$resize_image_fs_path = $file_fs_path . $file_name_prefix . '_large' . '.' . $file_extension;
break;
default:
$resize_image_ws_path = $file_ws_path . $file_name_prefix . '_small' . '.' . $file_extension;
$resize_image_fs_path = $file_fs_path . $file_name_prefix . '_small' . '.' . $file_extension;
}
if (file_exists($resize_image_fs_path) && is_file($resize_image_fs_path)) {
if ($image_size = @getimagesize($resize_image_fs_path)) {
$width = $image_size[0];
$height = $image_size[1];
/*
switch ($image_format_type) {
case 'thumb':
if ( !(($width == PRODUCTS_THUMB_IMAGE_SIZE) || ($height == PRODUCTS_THUMB_IMAGE_SIZE)) ) {
$ratio = $width / $height;
if ($width >= $height) {
$width = PRODUCTS_THUMB_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_THUMB_IMAGE_SIZE;
$width = round($height * $ratio);
}
}
break;
case 'small':
if ( !(($width == PRODUCTS_SMALL_IMAGE_SIZE) || ($height == PRODUCTS_SMALL_IMAGE_SIZE)) ) {
$ratio = $width / $height;
if ($width >= $height) {
$width = PRODUCTS_SMALL_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_SMALL_IMAGE_SIZE;
$width = round($height * $ratio);
}
}
break;
case 'medium':
if ( !(($width == PRODUCTS_MEDIUM_IMAGE_SIZE) || ($height == PRODUCTS_MEDIUM_IMAGE_SIZE)) ) {
$ratio = $width / $height;
if ($width >= $height) {
$width = PRODUCTS_MEDIUM_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_MEDIUM_IMAGE_SIZE;
$width = round($height * $ratio);
}
}
break;
case 'large':
if ( !(($width == PRODUCTS_LARGE_IMAGE_SIZE) || ($height == PRODUCTS_LARGE_IMAGE_SIZE)) ) {
$ratio = $width / $height;
if ($width >= $height) {
$width = PRODUCTS_LARGE_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_LARGE_IMAGE_SIZE;
$width = round($height * $ratio);
}
}
break;
}*/
} else {
return 'Getimagesize error in virtual thumb/small/medium/large resize';
}
$new_src = $resize_image_ws_path;
} elseif (file_exists($image_fs_path) && is_file($image_fs_path)) {
if ($image_size = @getimagesize($image_fs_path)) {
$get_width = $image_size[0];
$get_height = $image_size[1];
switch ($image_format_type) {
case 'thumb':
$ratio = $get_width / $get_height;
if ($get_width >= $get_height) {
$width = PRODUCTS_THUMB_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_THUMB_IMAGE_SIZE;
$width = round($height * $ratio);
}
break;
case 'small':
if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
if (empty($width) && $height) {
$ratio = $height / $image_size[1];
$width = round($image_size[0] * $ratio);
} elseif ($width && empty($height)) {
$ratio = $width / $image_size[0];
$height = round($image_size[1] * $ratio);
} elseif (empty($width) && empty($height)) {
$width = $image_size[0];
$height = $image_size[1];
}
}
break;
case 'medium':
$ratio = $get_width / $get_height;
if ($get_width >= $get_height) {
$width = PRODUCTS_MEDIUM_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_MEDIUM_IMAGE_SIZE;
$width = round($height * $ratio);
}
break;
case 'large':
$ratio = $get_width / $get_height;
if ($get_width >= $get_height) {
$width = PRODUCTS_LARGE_IMAGE_SIZE;
$height = round($width / $ratio);
} else {
$height = PRODUCTS_LARGE_IMAGE_SIZE;
$width = round($height * $ratio);
}
break;
}
} else {
return 'Getimagesize error in virtual thumb/medium/large resize';
}
$new_src = $image_ws_path;
} else {
return false;
}
} elseif (file_exists($image_fs_path) && is_file($image_fs_path)) {
if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
if ($image_size = @getimagesize($image_fs_path)) {
if (empty($width) && $height) {
$ratio = $height / $image_size[1];
$width = round($image_size[0] * $ratio);
} elseif ($width && empty($height)) {
$ratio = $width / $image_size[0];
$height = round($image_size[1] * $ratio);
} elseif (empty($width) && empty($height)) {
$width = $image_size[0];
$height = $image_size[1];
}
}
}
$new_src = $image_ws_path;
} else {
return false;
}
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . (($absurl) ? tep_output_string(HTTP_SERVER . '/' . $new_src) : tep_output_string($new_src)) . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) {
$image .= ' title=" ' . tep_output_string($alt) . ' "';
}
if (tep_not_null($width)) {
$image .= ' width="' . tep_output_string($width) . '"';
}
if (tep_not_null($height)) {
$image .= ' height="' . tep_output_string($height) . '"';
}
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
$image .= '>';
return $image;
}
}
Re: problema con nome file immagine prodotto
Inviato: 26/11/2008, 17:20
da shop155
fatemi sapere vi prego..
Re: problema con nome file immagine prodotto
Inviato: 03/12/2008, 0:58
da shop155
non mi abbandonate vi prego e scusate se insisto!
Re: problema con nome file immagine prodotto
Inviato: 03/12/2008, 1:03
da lavoriamopervoi
shop155 ha scritto:non mi abbandonate vi prego e scusate se insisto!
potresti installare un'altra contribution per creare il ridimensionamento automatico delle immagini...
tipo:
'On the Fly' Auto Thumbnailer using GD Library
Ciao
Antonello
Re: problema con nome file immagine prodotto
Inviato: 03/12/2008, 1:26
da shop155
ho dato un occhiata alla tua contribution
grazie!
ma dovrei anche toccare il database?
Re: problema con nome file immagine prodotto
Inviato: 03/12/2008, 1:53
da lavoriamopervoi
shop155 ha scritto:ho dato un occhiata alla tua contribution
grazie!
ma dovrei anche toccare il database?
no
Re: problema con nome file immagine prodotto
Inviato: 03/12/2008, 1:55
da shop155
ok allora lo provo...
speriamo bene!
Re: problema con nome file immagine prodotto
Inviato: 06/12/2008, 19:32
da shop155
ho provato ma non mi fa vedere le immagini dal lato cliente e mi genera tanti errori...
ma non esiste un modo per capire dove siia la funzione che mi cambia il nome delle immagini che carirco?