- 1,173
- 370
- CPU
- 13600K
- Dissipatore
- Thermalright Peerless Assassin 120 SE
- Scheda Madre
- MSI PRO Z790-P WIFI ATX
- HDD
- WD Black 1TB SN850X
- RAM
- Kingston Fury Renegade DDR5 Silver 32GB 6400MT/s CL32
- GPU
- Gigabyte RTX 4070 Ti GAMING OC 12G
- Monitor
- BenQ MOBIUZ EX3415R
- PSU
- Thermaltake Toughpower GF3 750W
- Case
- NZXT H5 Flow
- Periferiche
- Mouse: Logitech G403 - Tastiera: Durgod Taurus K320
- Net
- FTTC 100 mega
- OS
- Windows 11 Home 64 bit
Buongiorno a tutti, nel sito che sto costruendo ho la necessità di ridimensionare delle immagini in maniera tale da favorire il caricamento da parte degli utenti, non rendendo necessario il caricamento dell'immagine originale ma di una scalata.
Questo è il codice:
Ma visualizzando la pagina in questione l'immagine non appare, come posso procedere per risolvere? Grazie a tutti.
Questo è il codice:
PHP:
<?
list($width, $height, $type, $attr) = getimagesize($img_path);
$thumb = imagecreatetruecolor(50, 50 * $height / $width);
if($type == 2) $source = imagecreatefromjpeg($img_path);
if($type == 3) $source = imagecreatefrompng($img_path);
imagecopyresized($thumb, $source, 0, 0, 0, 0, 50, 50 * $height / $width, $width, $height);
?>
<img src="<?= $thumb; ?>" alt=""/>
Ma visualizzando la pagina in questione l'immagine non appare, come posso procedere per risolvere? Grazie a tutti.