Web Devout tidings


Archive for July, 2007

How to: Upload PNG, GIF, or BMP to Picasa Web Albums

Thursday, July 12th, 2007

After a few months of searching, I’ve finally figured out how to upload PNG, GIF, and BMP files to Picasa Web Albums without them being converted into JPEG. Here’s what to do:

  1. If you don’t already have one, sign up for a Blogger account at http://www.blogger.com/

  2. Create a new blog. The title will be the name of the album you want to make on Picasa Web Albums. You have to use Blog*Spot for the hosting, and you should pick a Blog*Spot address that no one else is likely to want (some random keyboard mashing will be fine). You’ll never need to actually visit this address.

    Warning: If an album of the same name already exists in your Picasa Web Albums account, they will *not* merge. You will end up having two albums of the same name (but different URL), which you probably don’t want. Take this into account before picking the blog name.

  3. Once your blog is set up, go to the “Create Post” page in Blogger.

  4. Click on the “Add Image” icon just above the post entry field. This will open an “Upload Images” window.

  5. Click on “Browse” and select the image you want to upload. This may be a JPEG (JPG), GIF, BMP, or PNG up to 8 MB in size.

  6. If you want to add multiple images at once, click on “Add another image”. A maximum of 5 images may be uploaded at once.

  7. Once you’re ready to upload, click the “Upload Image” button.

  8. After it’s finished uploading, optionally give the post a title (today’s date or something, just to identify the image upload session), save the draft, and leave Blogger. The post body may be blank and you don’t need to actually publish the post, but there has to at least be a draft saved or else the images will be lost.

  9. Go to your Picasa Web Albums account. If all went well, you should have a new album with a little Blogger logo in the bottom-left corner. If the album isn’t there, try waiting a few minutes and refresh. If it still isn’t there, you should recheck the steps above.

  10. To make the album public, open the album page in Picasa Web Albums, click on Edit Album Properties in the left sidebar, and set it to Public.

For these Blogger albums, you’ll always have to use Blogger to upload images; the regular Picasa Web Albums interface won’t let you upload images into those albums. But you can view them normally, set captions, comments, etc. The images retain the full pixel-precise quality and filesize of the original images, and you can manually download them in their original PNG/GIF/BMP formats.

It would be nice if Picasa Web Albums would allow us to simply upload PNG/GIF/BMP images from the regular upload interface, but this will have to do for now.

HTML good practice checker

Sunday, July 1st, 2007

Do you like clean markup? Do you use HTML and still prefer to quote all your attribute values, use lower-case tag names, and generally follow good clean markup practices? Do you wish you could force the HTML Validator to be even more strict so you could quickly identify stray XHTML-style self-closing tags in your HTML and other issues that it usually ignores?

If so, then you may find my new HTML good practice checker useful. It sets up a custom SGML declaration (for markup parsing rules) and DTD (for document structure rules) which instruct the W3C HTML Validator to be more strict with your document.

Here is a partial list of the new rules enforced:

  • All tag and attribute names must be lower-case.
  • All attribute values must be quoted.
  • Declarations are case-sensitive like in XML.
  • SGML Null End Tags (NET) are not allowed. This means that the validator will recognize that a <br /> in an HTML document is a problem.
  • End tags must be used on all non-empty elements. Note: If an end tag is forbidden in normal HTML, it’s still forbidden here.
  • Start tags must be used on all elements.
  • You may not write <tr> tags directly inside the table contents; you must include them in a tbody. In fact, in terms of document structure, tr was never truly allowed as a child of table in HTML. They were normally assumed to be within a tbody element with omitted start and end tags. So this rule is actually just a natural consequence of the above two rules. Note that HTML’s behavior is different from XHTML, where tr actually is allowed as a child of table, and the good practice rule of an explicit tbody element improves consistency between HTML and XHTML.
  • Nested tables are not allowed.
  • Unclosed tags and empty tags (obscure and poorly-supported SGML shorthand rules) are no longer allowed.
  • Attributes may no longer use minimized form (for example, the disabled attribute must be written disabled="disabled").
  • Hexadecimal character references must use a lower-case “x” like in XML.
  • The following presentational elements may not be used: tt, i, b, big, small.
  • The q element may not be used, due to major unresolvable compatibility issues.
  • The width and height attributes are required on img elements.
  • The name attribute has been removed on the a element. You should use id instead.
  • The following attributes were removed from the table element: width, border, frame, rules, cellspacing, cellpadding, datapagesize (a reserved attribute).
  • The following attributes were removed from all other table-related elements: width, align, char, charoff, valign.
  • On the script element, the reserved event and for attributes have been removed.
  • In order to avoid issues when user agents confuse UTF-8 and ISO-8859-1, characters above &#126; are no longer allowed to be written directly in the document. You should use character references for them.

I’m always open to feedback. For the most part, the things this system can check are currently limited to rules you can specify in the SGML declaration and DTD. Keep in mind that this system is new and it’s possible that there are bugs. If you come across any, please let me know.