Hirdetés
- Iterálunk, iterálunk? DeepCool AK700 Digital processzorhűtő
- CES 2026: felcsavarta az AI-t az AMD, de örülhetnek a játékosok is
- CES 2026: Teljesen szürreális lett az ASUS asztali gamer PC-je
- CES 2026: 1 kHz-es modell is akad az Acer idei monitorkínálatában
- CES 2026: Kojima segítségével tesz minden korábbi notebookot elavulttá az ASUS
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Két generációval korábbi GeForce gyártása indulhat újra
- Plazma TV topic
- Kompakt vízhűtés
- Kormányok / autós szimulátorok topikja
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- AMD vs. INTEL vs. NVIDIA
- 2026 a GDDR6-os VGA-k éve lesz?
- A legrosszabb CPU-k – az ExtremeTech szerint
- Milyen billentyűzetet vegyek?
Új hozzászólás Aktív témák
-
Tele von Zsinór
őstag
válasz
Speeedfire
#5009
üzenetére
static public function resizeAndMove($from_path, $to_path, $max_width, $max_height)
{
@ini_set("memory_limit", "128M");
$image_info = getImageSize($from_path);
switch ($image_info['mime']) {
case 'image/jpeg': $o_im = imageCreateFromJPEG($from_path); break;
//add more if needed
default:
return false;
}
$o_wd = imagesx($o_im) ;
$o_ht = imagesy($o_im) ;
if ($o_ht >= $o_wd) {
if ($o_ht > $max_height) {
$lamda = $max_height / $o_ht;
} else {
$lamda = 1;
}
} else {
if ($o_wd > $max_width) {
$lamda = $max_width / $o_wd;
} else {
$lamda = 1;
}
}
$t_ht = round($lamda * $o_ht);
$t_wd = round($lamda * $o_wd) ;
$t_im = imageCreateTrueColor($t_wd,$t_ht);
imageCopyResampled($t_im, $o_im, 0, 0, 0, 0, $t_wd, $t_ht, $o_wd, $o_ht);
imagePNG($t_im, $to_path );
imageDestroy($o_im);
imageDestroy($t_im);
}
Új hozzászólás Aktív témák
- Magyarország piacvezető szoftver webáruháza
- Xiaomi Redmi Note 13 5G 256GB,Újszerű,Dobozaval,12 hónap garanciával
- Apple iPhone 13 Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- Gyönyörű iPhone 13 128GB Fehér (100%) - 12 hónap JÓTÁLLÁS - Kártya független
- Apple iPhone 15 Pro Max 256GB,Átlagos,Dobozaval,12 hónap garanciával
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


