Forum Replies Created

Viewing 15 replies - 46 through 60 (of 182 total)
  • Thread Starter Chris Huff

    (@brochris)

    Thanks for helping me out! Your last tip especially helped me the most. Since it was, essentially, a race between the file progress being updated and the actual progress bar being updated, I found a good balance between the two. Also, and this was probably the biggest thing, the progress.php file was loading all of WordPress a second time (require_once(‘../../../wp-load.php’);) just to get one option from the database. So I converted progress.php to use a flat file written and read with javascript, which speeds up the whole process a ton.

    Again, thanks for your insight!

    I use the plugin Imsanity to do exactly what you describe.

    Facebook uses Open Graph tags as the primary way it pulls information from a link being shared. If a link doesn’t contain those tags, it tries to do its best to find appropriate descriptions, but it doesn’t always do very well.

    If your theme doesn’t include Open Graph tags by default, you might consider a good SEO plugin. SEO Ultimate is one such plugin that allows you to specify the “Social Network Listing” data for each post, which then adds the Open Graph tags.

    Plugin Author Chris Huff

    (@brochris)

    Hi, what kinds of special characters?

    Plugin Author Chris Huff

    (@brochris)

    Sorry it’s taken so long, but the new version of the plugin, which includes a fix for the default disable issue, is coming out in the next couple days.

    Plugin Author Chris Huff

    (@brochris)

    Good news!

    The next version of the plugin (coming out in the next few days) will have the option to set a maximum number of characters to be written to the image.

    This will allow you to write, say, the first 50 or 100 (or however many) characters of the Post Title to the image, and the plugin will not stall or timeout.

    Hope this helps!

    Plugin Author Chris Huff

    (@brochris)

    Have you been able to make any progress with this? I’m pretty much at a standstill with it.

    Plugin Author Chris Huff

    (@brochris)

    Strange. That code should prevent post revisions from having images generated.

    Is there something unique about your WordPress environment?

    If you haven’t yet done so, please disable all other plugins to see if the problem still happens at that point.

    Plugin Author Chris Huff

    (@brochris)

    Hi, sorry you’re experiencing this issue.

    I’ll have to look into the Contact Form 7 issue when I get back to my workstation.

    As for the revision issue, that certainly shouldn’t be happening. Take a look at my plugin’s code around line 53. You should see this:

    // If this is just a revision, don't generate an image
        if ( wp_is_post_revision($post->ID) )
        return;

    That should prevent it from creating images for revisions. Make sure the code is there.

    Are you updated to the latest version of the plugin? It should be 2.2.

    Plugin Author Chris Huff

    (@brochris)

    Awesome. If you make any progress let me know. I’d love to be able to release this as a free add-on.

    Plugin Author Chris Huff

    (@brochris)

    Hi! Glad the plugin is beneficial to you!

    Yes, extremely long titles will cause the plugin to time-out, especially when the image dimensions are small. I’ve been thinking about how to possibly prevent time-outs, but the plugin could be configured so many ways that it would be nearly impossible (considering font sizes, image dimensions, padding, etc). But I will continue to think on it.

    Anyway, glad you were able to get it figured out.

    Plugin Author Chris Huff

    (@brochris)

    Could you get at least the first rule to work, as it did for me? That tells me that we’re at least on the right track.

    I’ve tried all kinds of different encoding tricks. I could be wrong, but I don’t think the problem is in the encoding (although, I did have to convert to numerically-escaped encoding in order to find and convert characters within the string…copying and pasting the Hindi characters just wouldn’t work).

    It seems to me that the problem is just that PHP (and the GD library specifically) simply doesn’t understand Hindi. Hindi often combines two or more characters into one, but there is no corresponding numerically-escaped encoding for that new character. For example, when I combine characters प and ् and र the result should be प्र. But there is no code for प्र other than the three codes for the characters which make it up. When PHP and GD library see the three codes which should make the one character, it doesn’t know to treat it as one slightly morphed character, and it attempts to write each character individually, and results in the wrong glyphs below.

    I’ve tried many many ways to fix this, but I’m stumped. Feel free to tinker with it and let me know if you are able to make any headway.

    Plugin Author Chris Huff

    (@brochris)

    Probably. Trying to implement the additional 10 rules you listed above, but either I have them coded wrong, or else those rules just aren’t coming into play with the block of text you gave me. Check out these images:

    Without any Hindi rules implemented:

    https://i.imgsafe.org/153f18867a.jpg

    With the Hindi rules you mentioned:

    https://i.imgsafe.org/153fe632cb.jpg

    As you can see, the first rule works, but the other 10 seem to have no effect.

    Here’s the code I’m working on…

    $words = explode(" ", $auto_image_text_to_write);
        for($k = 0; $k < count($words); $k++){
    
            // detect if the string was passed in as unicode
            $text_encoding = mb_detect_encoding($words[$k], 'UTF-8, ISO-8859-1');
    
            // make sure it's in unicode
            if ($text_encoding != 'UTF-8') {
                $words[$k] = mb_convert_encoding($words[$k], 'UTF-8', $text_encoding);
                }
    
            // html numerically-escape everything (&#[dec];)
            $words[$k] = mb_encode_numericentity($words[$k], array (0x0, 0xffff, 0, 0xffff), 'UTF-8');
    
            $arr = explode("&#", $words[$k]);
            for ($i = 0; $i < (count($arr)-1); $i++){
    
                // interchange the order of "i" vowel
                  if($arr[$i] == "2367;") {
                    $arr[$i] = $arr[$i-1] . '';
                    $arr[$i-1] = "2367;";
                    }
    
                // letter "I" + Nukta forms letter vocalic "L"
                  if($arr[$i] == "2311;") {
                    if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2316;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // vowel sign vocalic "R" + sign Nukta forms vowel sign vocalic "Rr"
                  if($arr[$i] == "2371;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2372;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // Candrabindu + sign Nukta forms Om
                  if($arr[$i] == "2305;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2384;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // letter vocalic "R" + sign Nukta forms letter vocalic "Rr"
                  if($arr[$i] == "2315;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2400;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // letter "Ii" + sign Nukta forms letter vocalic "LI"
                  if($arr[$i] == "2312;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2401;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // vowel sign "I" + sign Nukta forms vowel sign vocalic "L"
                  if($arr[$i] == "2367;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2402;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // vowel sign "Ii" + sign Nukta forms vowel sign vocalic "LI"
                  if($arr[$i] == "2368;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2403;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // Danda + sign Nukta forms sign Avagraha
                  if($arr[$i] == "2404;") {
                      if($arr[$i+1] == "2364;") {
                        $arr[$i] = "2365;";
                        $arr[$i+1] = '';
                        }
                    }
    
                // consonant + Halant + Halant + consonant forms consonant + Halant + ZWNJ + consonant
                  if($arr[$i] == "2381;") {
                      if($arr[$i+1] == "2381;") {
                      //$arr[$i+1] = '8204;';
                        }
                    }
    
                // consonant + Halant + Nukta + consonant forms consonant + Halant + ZWJ + Consonant
                  if($arr[$i] == "2364;") {
                      if($arr[$i+1] == "2381;") {
                      //$arr[$i] = "2381;";
                      //$arr[$i+1] = '8205;';
                        }
                    }
    
                }
    
            $words[$k] = implode('&#',$arr);
            }
    
        $auto_image_text_to_write = implode(" ", $words);
    Plugin Author Chris Huff

    (@brochris)

    It would be difficult to send it to you as an add-on at this point. It’s not yet formatted for distribution.

    I was able to implement the first rule, but when I use the same method to implement the next ten rules you listed, they don’t seem to have any affect on the generated text. But I think this is just because the text I’m testing it with doesn’t include the specified characters. Could you give me a paragraph of Hindi text that makes use of the various rules so that I can test whether my plugin is handling each one correctly?

    According to this chart (http://jrgraphix.net/r/Unicode/0900-097F) there are 32 characters which attach in some way to either the previous or next character. We will likely need to account for each one of them.

    Plugin Author Chris Huff

    (@brochris)

    I’ve been running tests using various settings, but I haven’t been able to replicate this issue.

    Are you using the latest version of the plugin (2.2)?

    Is there possibly something unique about your WordPress environment or implementation that might be a factor?

    Please disable all other plugins and test see if the the issue persists. If not, enable your other plugins one at a time, and save/update a post each time to see which plugin is conflicting with mine.

Viewing 15 replies - 46 through 60 (of 182 total)