Skip to main content.
March 2nd, 2006

CableCARD

So I finally got my Philips TV set up with CableCARD woo hoo!

I went over to the Comcast store and picked up a CableCard. I stuck it in the TV and it said it had detected the CableCARD and synched the channel list to the favorites as described on the CableCARD. However, changing channels would only switch between the external inputs.

I spent a lot of time with Comcast support and Philips support trying to get it to work with both sides just pointing to each other. Finally, Comcast said they would send a tech over to get it figured out. We scheduled the appointment and then I decided to try one last time. I stuck the CableCARD back in and left the dialog up. I came back after 15 minutes and all the digital channels were there!

Now if only I could figure out a way to record those channels…

Posted by donutello as Uncategorized at 11:39 AM MST

No Comments »

February 25th, 2006

Postie image width mod

I don’t like the way Postie resizes images. It only lets you specify the maximum width. What this does is result in images that are in landscape mode ending up a lot smaller than images that are in portrait mode. Aesthetically, it’s not a good look. I made the following changes to fix it. I work around that problem by using the value for maximum width as the value for the maximum height also.

The following code changes are needed in postie-functions.php

Replace the function ResizeImage with:


function ResizeImage($file,$type) {
    $config = GetConfig();
    $sizeInfo = DetermineImageSize($file);
    $fileName = basename($file);
    if (($sizeInfo[0] > $config["MAX_IMAGE_WIDTH"]) || ($sizeInfo[1] > $config["MAX_IMAGE_WIDTH"])) {
        if ($config["USE_IMAGEMAGICK"]) {
            return(ResizeImageWithImageMagick($file,$type));
        }
        else {
            return(ResizeImageWithGD($file,$type));
        }
    }
    return(array("",$fileName));

Replace the function ResizeImageWithImageMagick with:


function ResizeImageWithImageMagick($file,$type) {
    //print("<h1>Using ImageMagick</h1>");
    $config = GetConfig();
    $sizeInfo = DetermineImageSize($file);
    $fileName = basename($file);
    $scaledFileName = "";
    if ((($sizeInfo[0] > $config["MAX_IMAGE_WIDTH"]) || ($sizeInfo[1] > $config["MAX_IMAGE_WIDTH"]))
            && file_exists($config["IMAGEMAGICK_CONVERT"]))  {
            $yscale = $config["MAX_IMAGE_WIDTH"]/$sizeInfo[1];
            $xscale = $config["MAX_IMAGE_WIDTH"]/$sizeInfo[0];
            $scale = min($xscale, $yscale);
            $scaledH = round($sizeInfo[1] * $scale );
            $scaledW = round($sizeInfo[0] * $scale );
            $scaledFileName =  "thumb.".$fileName;
            $scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
            @exec (escapeshellcmd($config["IMAGEMAGICK_CONVERT"]) .
                        " -resize " .
                        $scaledW .
                        "x" .
                        $scaledH  .
                        " " .
                        escapeshellarg($file) .
                        " " .
                        escapeshellarg($scaledFile) );

            @exec ('chmod 755 ' . escapeshellarg($scaledFile));
    }
    return(array($scaledFileName,$fileName));

Replace the function ResizeImageWithGD with:


function ResizeImageWithGD($file,$type) {
    $config = GetConfig();
    $sizeInfo = DetermineImageSize($file);
    $fileName = basename($file);
    $scaledFileName = "";
    if (($sizeInfo[0] > $config["MAX_IMAGE_WIDTH"]) || ($sizeInfo[1] > $config["MAX_IMAGE_WIDTH"])) {
        $sourceImage = NULL;
        switch($type) {
            case "jpeg":
            case "jpg":
            case "pjpeg":
                $sourceImage = imagecreatefromjpeg($file);
                break;
            case "gif":
                $sourceImage = imagecreatefromgif($file);
                break;
            case "png":
                $sourceImage = imagecreatefrompng($file);
                break;
        }
        if ($sourceImage) {
            $yscale = $config["MAX_IMAGE_WIDTH"]/$sizeInfo[1];
            $xscale = $config["MAX_IMAGE_WIDTH"]/$sizeInfo[0];
            $scale = min($xscale, $yscale);
            $scaledH = round($sizeInfo[1] * $scale );
            $scaledW = round($sizeInfo[0] * $scale );
            $scaledFileName =  "thumb.".$fileName;
            $scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
            $scaledImage = imagecreatetruecolor($scaledW,$scaledH);
            imagecopyresized($scaledImage,$sourceImage,0,0,0,0,
                            $scaledW,$scaledH,
                            $sizeInfo[0],$sizeInfo[1]);
			imagejpeg($scaledImage,$scaledFile,$config["JPEGQUALITY"]);
            @exec ('chmod 755 ' . escapeshellarg($scaledFile));
            imagedestroy($scaledImage);
            imagedestroy($sourceImage);
        }
    }
    return(array($scaledFileName,$fileName));

}

Posted by donutello as wordpress at 11:48 PM MST

2 Comments »

Postie image click fix

The HTML that Postie generates for thumbnail images didn’t quite work right for me. Clicking on the thumbnail just scrolled to the top of the page rather than opening the larger image. If you are experiencing the same problem, you can do what I did. Make the following changes to postie-functions.php and the larger images will be loaded in the same window.

Replace:


if ($thumbImage) {
    $attachments["html"][] .= $mimeTag.'<a href="#" onclick=" window.open(' ."'"
    . $config["URLPHOTOSDIR"] . $fullImage . "','"
    . $part->ctype_parameters['name'] . "','"
    . "toolbar=0,scrollbar=0,location=0,statusbar=0,menubar=0,resizable=1" . "');"
    . '"><img src="' . $config["URLPHOTOSDIR"] . $thumbImage . '" alt="'
    . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a>' . "n";

with


if ($thumbImage) {
    $attachments["html"][] .= $mimeTag.'<a href="' . $config["URLPHOTOSDIR"] . $fullImage
    . '"><img src="' . $config["URLPHOTOSDIR"] . $thumbImage . '" alt="'
    . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a>' . "\n";

Posted by donutello as wordpress at 11:30 PM MST

3 Comments »

Hello world!

Welcome to my new blog. I don’t have an agenda for this blog. I’m just going to post whatever I feel like expressing or sharing with the rest of the world.

Posted by donutello as Uncategorized at 10:29 PM MST

2 Comments »