4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on March 20, 2005, 08:14:48 PM

Title: [Mod] Remote Image Thumbnail Creation
Post by: V@no on March 20, 2005, 08:14:48 PM
This mod will create thumbnails from remote images uploaded through members upload page (not ACP)


Step 1.
Open /member.php
Find:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none" && !$uploaderror) {
      if ($direct_upload) {
        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else {
        $src = MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".$new_name;
      }
Replace with:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && (!empty($HTTP_POST_FILES['media_file']['tmp_name']) || $new_name) && ($HTTP_POST_FILES['media_file']['tmp_name'] != "none" || $new_name) && !$uploaderror) {
      if (is_remote($new_name)){
        $name = MEDIA_TEMP_PATH."/".md5(time()).".".get_file_extension($new_name);
        if ($infile = fopen ($new_name, "rb")) {
          $outfile = fopen ($name, "wb");
          while (!feof ($infile)) {
            fwrite($outfile, fread ($infile, 4096));
          }
          fclose($infile);
          fclose($outfile);
        }
      }
      if ($direct_upload) {
        $src = (is_remote($new_name)) ? $name : MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }
      else {
        $src = (is_remote($new_name)) ? $name : MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }


Step 1.2.
Find:
Code: [Select]
            $new_thumb_name = $new_name;Replace with:
Code: [Select]
            $new_thumb_name = (is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name;

Step 1.3.
Find
Code: [Select]
     }

    if (!$uploaderror) {
Insert above:
Code: [Select]
      if (is_remote($new_name)){
        unlink($name);
      }
MAKE SURE U INSERTED IT ABOVE CLOSING BRACKET! ( } )

Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: vanish on April 11, 2005, 10:18:23 PM
What about Step 1.3 if "Auto Image Resizing " is installed?
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: V@no on April 12, 2005, 12:22:15 AM
what about it?
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: vanish on April 12, 2005, 12:32:46 AM
Quote
Step 1.3.
Find Code:
Code: [Select]
     }


    if (!$uploaderror) {

but
Code: [Select]
     }

-------------- Here is placed code from your MOD "Auto Image Resizing "---------------------------

    if (!$uploaderror) {

many people will have a troubles  8)
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: V@no on April 12, 2005, 01:45:39 AM
I put BIG RED note about where the code should be placed...if someone have trouble with that, I'm sorry, but I wouldnt even bother to explain any further...
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: vanish on April 12, 2005, 09:25:21 AM
I want to say, what "CLOSING BRACKET" in two cases (with and without MOD  "Auto Image Resizing ") not the same. That's all.
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: V@no on April 12, 2005, 10:09:30 AM
ah, I see, thanks for letting me know ;)
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: SAD on November 02, 2005, 03:58:39 PM
Hi!

if download remote image in one category:

http://wwwwwww/image22.jpg
--> create thumbnailer "image22.jpg"

next download
http://yyyyyyyyyyy/image22.jpg
--> create thumbnailer "image22.jpg"

Result:
one thumbnailer "image22.jpg" for two remote image.
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: V@no on November 02, 2005, 08:02:26 PM
Hi!

if download remote image in one category:

http://wwwwwww/image22.jpg
--> create thumbnailer "image22.jpg"

next download
http://yyyyyyyyyyy/image22.jpg
--> create thumbnailer "image22.jpg"

Result:
one thumbnailer "image22.jpg" for two remote image.
is there a question in your reply? :?
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: SAD on November 03, 2005, 07:26:52 AM
 :?
Yes, a question such:
How to change a name of a file if such file already is.
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: fgallery on November 08, 2005, 12:52:07 PM
The MOD works fine.
Thanks !
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: JensF on January 06, 2006, 07:07:14 PM
Hi,

i have install this mod and my question is, i have a lot remote pics with no thumb. but when i search for it with the auto thumbnailer there where not find.
can i create a thumbnail for exist remote pics????
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: V@no on January 07, 2006, 04:44:53 AM
No, not with this mod. This is what you are looking for:
http://www.4homepages.de/forum/index.php?topic=6921.0
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: JensF on January 07, 2006, 11:52:53 AM
Thanks, thats it :)
Title: Bug when space is in Jpeg name Remote Image Thumbnail Creation
Post by: mohab on May 29, 2006, 01:15:09 PM
Hi V@no
Great mod and mostly perfect runing for a long time.
But know i get a little bug .
For a Remote image witch contain a Space in the filename it will not kreate a working thumbnail.
I know ther shoud be never any space in files for the web ,but some registered user dont know and upload remote image via Url.

To explain   the image  "foto children.jpeg"   --> "foto%children.jpeg"
The Orginal foto is working but the thumb will be a brocken link
any simpel way to exclude this little problem

Thanks a lot
Mohab vienna
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: Stoleti on June 16, 2006, 06:12:30 AM
i've got this error :

Warning: chdir(): No such file or directory (errno 2) in /home/****/public_html/includes/annotate.php on line 11

Warning: rename(for_you.jpg,for_you.jpg.bak): Permission denied in /home/****/public_html/includes/annotate.php on line 12

how fix it ?
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: Romson on October 12, 2007, 10:10:31 AM
Hi!

if download remote image in one category:

http://wwwwwww/image22.jpg
--> create thumbnailer "image22.jpg"

next download
http://yyyyyyyyyyy/image22.jpg
--> create thumbnailer "image22.jpg"

Result:
one thumbnailer "image22.jpg" for two remote image.

Hallo,

also ich hab das gleiche Problem.

Mal angenommen das thumbnail bild heist bild123.jpg und es wird in die kategorie nr. 3 hochgeladen ..... wenn sich in der kategorie aber bereits ein thumbnail mit dem gleichen namen bild123.jpg befindet dann wird es einfach überschrieben
ist das bei euch so ?

das thumbnail müsste also beim upload umbenannt werden falls es bereits eine datei mit diesem namen gibt

vielleicht mag sich jemand eine lösung ausdenken, würde mir sehr helfen da ich schon seit tagen dran sitze  :|
Title: Re: [Mod] Remote Image Thumbnail Creation
Post by: surferboy on April 20, 2010, 08:38:53 AM
Hi -

Is this MOD still included because some folks may have installed it a while back

Isn't the MOD Auto-Thumbnailer v2.3.1 the replacement for this, or am I missing a fundamental concept between the two MOD's?

Thanks for your comments.

Brian