Author Topic: Auto-Image-Resizer HöhexBreite / widthxheight  (Read 4501 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Auto-Image-Resizer HöhexBreite / widthxheight
« on: January 10, 2009, 06:11:41 PM »
Hallo,

wenn man auf den "Auto-Image-Resizer" klickt, kann man dort die Thumbnail Größe angeben. Ist es auch möglich, dass man die Höhe und die Breite angeben kann? Damit man die Größe genau bestimmen kann?

---

   
Hello,

when you look at the "Auto-Image Resizer" clicks, you can then specify the thumbnail size. Is it possible that the height and width can be? In order to accurately determine the size of it?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Auto-Image-Resizer HöhexBreite / widthxheight
« Reply #1 on: January 10, 2009, 07:21:08 PM »
hi,

ich hab dies auf diese weise mit GD realisiert.. ist aber eine FIXE angabe, also ohne admin cp

includes/image_utils.php

Code: [Select]
function resize_image_gd($src, $dest, $quality, $width, $height, $image_info) {
  global $convert_options;

  $types = array(1 => "gif", 2 => "jpeg", 3 => "png");
  if ($convert_options['convert_gd2']) {
    $thumb = imagecreatetruecolor(142, 81);
  }
  else {
    $thumb = imagecreate(142, 81);
  }
  $image_create_handle = "imagecreatefrom".$types[$image_info[2]];
  if ($image = $image_create_handle($src)) {
    if ($convert_options['convert_gd2']) {
      imagecopyresampled($thumb, $image, 0, 0, 0, 0, 142, 81, ImageSX($image), ImageSY($image));
    }
    else {
      imagecopyresized($thumb, $image, 0, 0, 0, 0, 142, 81, ImageSX($image), ImageSY($image));
    }

    if ($image_info[2] == 3) {
      $quality = 9;
    }

    $image_handle = "image".$types[$image_info[2]];
    $image_handle($thumb, $dest, $quality);
    imagedestroy($image);
    imagedestroy($thumb);
  }
  return (file_exists($dest)) ? 1 : 0;
}

siehe die werte 142, 81
die thumbnails werden immer in dieser resolution erstellt.. im admin cp musst nur die qualität einstellen.. sonnst nichts mehr

bitte aber zuerst testen, weil ich mir nicht sicher bin ob dies bei verkleinern der bildern stören könnte...

du musst aber beachten das die thumbnails mit fixen angaben verzert dargestellt werden.. siehe mein site oder dieses thumb

lg
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: Auto-Image-Resizer HöhexBreite / widthxheight
« Reply #2 on: March 15, 2010, 01:22:16 AM »
Das ist eigentlich recht gut.
Aber ich verstehe einfach nicht, warum das bis heute nicht im ACP umgesetzt wurde. Das wäre sehr hilfreich!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)