Jump to content
TNG Community

thumbnail generation problem - newbie question


dbodor

Recommended Posts

I'm very new to php and would appreciate your expertise. I've been struggling with automatic thumbnail generation for a few weeks now. After correcting a few other potential problems like filenames containing multiple dots, and filenames with mismatched case, I had given up and gone to manually creating and linking thumbnails. That worked for a while, but then I wanted to upload a revised GEDCOM and more photos, and it took me back to square one. I don't want to redo all that manual work each time I decide to upload a revised GEDCOM with added photos. So I started looking at generatethumbs.php. Knowing very little about php, but some about basic programming, I tried a revised version which removed lines 46-51

if( $row[thumbpath] ) {

if( (!$regenerate && file_exists( "$rootpath$usefolder/$row[thumbpath]" )) || !in_array($ext,$imagetypes) )

$newthumbpath = "";

else

$newthumbpath = "$rootpath$usefolder/$row[thumbpath]";

}

And then changed the elseif on line 52 to if

elseif( $row[path] && in_array($ext,$imagetypes) ) {

//insert prefix in path directly before file name

I uploaded the revised file and Yeah! It works! Now, my question is what is the function of the part I removed? Will this solution cause a different problem? Why did the original version cause me problems to begin with?

By the way, with the old version, all the photos received the same thumbnail image, named only the thumbnail prefix "thumb_"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...