In WordPress 2, images (or other files) uploaded through the upload tool in the post editor are added to the database* under the posts table and assigned a post status of ‘attachment’. When editing a particular post uploads at that time will be “attached” to that post (they are assigned as the ‘post_parent’ of an attachment), but it’s not some sort of requirement that the image be attached to the post it’s displayed with.
* Images are not *actually* added to the database; just a few important bits of data about them.
Okay, thanks. Do you know what purpose ‘post_parent’ serves, if any at this point? More broadly, will anything break if posted images do not have a post_parent?
And, more specifically, if I change my URI from mydomain.com/blog to mydomain.com/ will anything get broken, since my images are linked manually.
Offhand I know of little internally which cares about the post_parent on an attachment except the post admin and rewrite (permalink) rules.
Images/files show under Browse for the post they’re attached to instead of Browse All, so there’s a bit of organization value to it.
With rewrite rules when using anything other than the default permalink you can do this:
Post:
http://guff.szub.net/2006/01/29/woof
Attachment:
http://guff.szub.net/2006/01/29/woof/fire-dog
Though at this point I’m not sure how useful it is. :)
As for the rest, an image correctly linked to in a post should display. If the directory structure remains the same (i.e. wp-content/uploads or whatever), moving your blog up a directory should not affect the internal stuff on the attachment, but the link or image reference to it in a post will be affected if your image director(y|ies) move along with it. This would be the case with or without an “attachment” feature.
Thanks for the comprehensive response Kafkaesqui.
Okay, I get the above.
My problem is that I have a db entry for an image, a physical image and a physical thumbnail with the exact same rights and naming convention as my other images. But it still shows a line through ‘No Thumbnail’ when I try to add it to the post. It shows up when editing the post_parent and all.
I found out that an image of 523K does get resized correctly but my other image (700+ K) fails. If I resize it to a somewhat more modest scale it works fine.
Is the image thumbnail also database aware?