Update:
With thanks to y2ksw for building in some debug code to a special beta version to troubleshoot problems with this mod, we have been able to isolate the issues that are causing hangs (cron lock-ups), which we and others may be experiencing. He's pretty busy at work, so suggested that we post our findings here so that possibly programmers such as
BirdOPrey5 or others, might be able to help us figure out how to fix the lock up issue.
It appears that the mod locks up when it encounters pics referred to with the IMG tag from other sites such as photobucket etc., that are 1024x768 pixels or larger. I original thought that it also might have something to do with byte size as well, since we do have some inconsiderate posters who IMG link to external pics that are 1 Mb and even up to 3 Mb in size.
However, after checking over over 100 pics that the mod failed and hung-up on, there are a lot that are reasonably sized (100k to 300k), but are over 1024x768 in pixel size, so my assumption is the hangs are caused by the handling of pixel sizes as opposed to file sizes. The 1024x768 number is a guess, purely based upon the fact that the mod seems to process pics with that pixel width and height, but we haven't been able to find ANY pic over that sizing that hasn't locked up the mod.
We've been able to manually circumvent the problem by running the cron job manually a forum at a time. Once it hangs, we examine the Cron Error Log and look at the code. It looks like this at the point it's locked up and stopped processing:
Quote:
=======================================
vB4 Import External Images
2011-02-16 08:00:02 345 Get forum ID's
2011-02-16 08:00:02 349 Get image tags
2011-02-16 08:00:02 358 Adjust options
2011-02-16 08:00:02 379 Cache registered image URL's
2011-02-16 08:00:02 177 SELECT oldurl, newurl
FROM iei_img
2011-02-16 08:00:02 386 For each record with images ...
2011-02-16 08:00:02 389 Include an/or exclude specific forum sections
2011-02-16 08:00:02 409 SELECT postid, p.dateline, pagetext
FROM post p
INNER JOIN thread t ON p.threadid = t.threadid
WHERE iei_parsed=0
AND forumid IN (72)
ORDER BY postid
LIMIT 0, 10
2011-02-16 08:00:02 413 Post: 61775
2011-02-16 08:00:02 417 Find all embedded images
2011-02-16 08:00:02 420 Searching for tag: img
2011-02-16 08:00:02 430 Search for images to be ignored
2011-02-16 08:00:02 445 If we haven't got the image yet, download
2011-02-16 08:00:02 453 Pseudo-loop
2011-02-16 08:00:02 456 Get file from remote site
2011-02-16 08:00:02 285 Use CURL for: http://www.thefirearmblog.com/blog/w...compressed.jpg
2011-02-16 08:00:03 324 Content size: 788141
2011-02-16 08:00:03 464 Get file extension
2011-02-16 08:00:03 467 Make path
2011-02-16 08:00:03 471 Get file name and/or index
2011-02-16 08:00:03 139 Get only the file name (no directory info)
2011-02-16 08:00:03 142 Strip out non alpha-numeric characters
2011-02-16 08:00:03 145 Set max file name length to 40 characters
2011-02-16 08:00:03 148 Increment number if file exists
2011-02-16 08:00:03 481 See if we have valid contents
===========================================
|
We check the post ID, call it up on the forums and invariably, it's an IMG reference to an off-site pic that's bigger than 1024x768 pixels.
We then SAVE the pic to our local drive. Delete the reference in the post to it. Use the vBulletin advanced ATTACH javascript to upload it to the post as an attachment and SAVE the edited post.
We re-start the cron job and it now moves past this post and proceeds normally until it runs into another post with an IMG referenced pic larger than 1024x768.
Using this workaround, we've been able to work through some of our forums, but it takes 6-8 hours of manual work to do so.
So, the question is, can someone help us by looking at the code and figuring out where *and why) it's locking up on these 1024x768 pics? Perhaps it needs a pixel re-sizer function built in front of it, BEFORE it begins to import the pic?
Second problem ...
We discovered an anomaly as to file name conventions (see attached pic). It appears that in some cases the mod imports and stores the pics, but for some reason it attaches ?t=xxxxxx or ?a=xxxxx after the .jpg extension (see attached pic). In the actual post, the filename is the same way, but of course the pic doesn't show.
If I manually rename the file in both the offending post and the associated /includes directory, it fixes the problem and the pics appear in the post. Unfortunately, so far, I can't find a simple way to locate all the filenames on the server that are messed up and also find them in the actual forums so I can start manually fixing posts.
This one y2ksw says is fixable by turning ON the
Always Convert Images option. Y2ksw explained why this would stop the problem from occurring in future, but not being as technical as he is, I didn't quite understand it. We're still trying to figure how to locate all the pics that have been processed already and perhaps some kind of automated handling to adjust the file names on both the server and the associated posts, so they actually appear.
Anyway, this is an excellent mod, particularly for a research site such as ours, to enable us to preserve old posts and pics for posterity. With just a bit more de-bugging and sorting out this critical hanging problem, it would be perfect....
Hope this helps other users here who may be considering using this mod for their sites, particularly larger ones with lots of pics.
Regards,
Doug