Image Attachments

General info, hints, guidelines and rules for all XnView forums. Guests and new users please read here first.

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Image Attachments

Post by XnTriq »

<--// Moderator's note: This topic has been split off from topic #29167. //-->
XnTriq wrote:
cday wrote:I don't know why there's a black line around the image -- it's not shown in the screenshot 'After' display?
The border is not in the image data of your attachment (lqFT3Tp-transformed.png), cday. That's done by the forum's default style (“prosilver”).
To be sure, you can either view this page in print mode or switch to “subsilver2” via User Control Panel » Board preferences » Edit global settings » My board style.

<!--// EDIT //
  • Firefox lets you turn the page's CSS off: View » Page Style » No Style
// EDIT //-->
cday wrote:But why is there a black border on the image I uploaded and not on the example images that were uploaded originally -- both viewed with the same forum settings?
Depending on how an image is embedded in a post, phpBB generates different HTML — which in turn has varying CSS (formatting) assigned to it. In “prosilver”, images embedded with [attachment=][/attachment] BBCode tags are displayed with a border, while images embedded with [img][/img] BBCode tags are not.
BBCode guide ([url=http://newsgroup.xnview.com/faq.php?mode=bbcode#f5r0]Showing images in posts[/url]) wrote:Adding an image to a post

phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are: many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with [img][/img] tags. For example:

Code: Select all

[img]http://www.google.com/intl/en_ALL/images/logo.gif[/img]
As noted in the URL section above you can wrap an image in a [url][/url] tag if you wish, e.g.

Code: Select all

[url=http://www.google.com/][img]http://www.google.com/intl/en_ALL/images/logo.gif[/img][/url]
would generate:

Image

Adding attachments into a post

Attachments can now be placed in any part of a post by using the new [attachment=][/attachment] BBCode, if the attachments functionality has been enabled by a board administrator and if you are given the appropriate permissions to create attachments. Within the posting screen is a drop-down box (respectively a button) for placing attachments inline.
User philippetev uploaded his examples to an external server. Images hosted on a different site have to be embedded with [img][/img] tags:

Code: Select all

[img]http://i.imgur.com/nLrhAou.png[/img]
Result: Image

You OTOH chose to include your images as an attachment (to be uploaded to and stored on the server of newsgroup.xnview.com) and inserted the [attachment=][/attachment] tags with the Place attachment inline button:

Code: Select all

[attachment=0]Image_1.png[/attachment]
[attachment=1]lqFT3Tp-transformed.png[/attachment]
Please note that the [attachment=][/attachment] tags only work in the post the attachments are “associated” with.
Your attachments have been given the IDs #1480 (lqFT3Tp-transformed.png) and #1481 (Image_1.png). Both attachments “belong” exclusively to your post #116286.
If you (or anybody else for that matter) would like to place these attachments into another post, they have to find out the ID of that attachment and embed it with the help of [img][/img] tags:

Code: Select all

[img]http://newsgroup.xnview.com/download/file.php?id=1480[/img]
Result: Image

Code: Select all

[img]http://newsgroup.xnview.com/download/file.php?id=1481[/img]
Result: Image

Code: Select all

[img]http://newsgroup.xnview.com/download/file.php?id=1481&t=1[/img]
Image

Code: Select all

[url=http://newsgroup.xnview.com/download/file.php?id=1481][img]http://newsgroup.xnview.com/download/file.php?id=1481&t=1[/img][/url]
[url=http://newsgroup.xnview.com/download/file.php?id=1481]Image_1.png[/url]
Image
Image_1.png
cday
XnThusiast
Posts: 3973
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Image Attachments

Post by cday »

Thanks for the detailed explanation: basically, one image was uploaded to the forum as an attachment and the other was linked to an external image hosting server, and the present board setting encode the images displayed differently?

And presumably similar considerations explain why some images are now displayed as thumbnails and others are still displayed full size?
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Image Attachments

Post by XnTriq »

cday wrote:basically, one image was uploaded to the forum as an attachment and the other was linked to an external image hosting server, and the present board setting encode the images displayed differently?
It's the [attachment=][/attachment] and [img][/img] tags which are interpreted differently. As a consequence, the board's HTML output to present the images on the webpage is not the same. At least in phpBB, the uploaded images are left untouched and aren't re-encoded.
There's no board setting to turn this behavior on & off. Admins can only specify which files are identified as images (or videos etc.), depending on their extensions.

If you're a Firefox user and your board style is “prosilver”, you can (temporarily) turn the borders off by editing the CSS of your post. Go to Tools » Web Developer » Style Editor and paste the following rule at the very end of style.php?id=1:

Code: Select all

dl.thumbnail img,
dt.attach-image img {
border: 0 none;
}
The border now only shows up when you move the mouse cursor over the thumbnail for Image_1.png.
cday wrote:And presumably similar considerations explain why some images are now displayed as thumbnails and others are still displayed full size?
phpBB does not generate thumbnails for image attachments smaller than 12000 bytes (default value) and for images hosted on different servers. I assume the latter is due to copyright issues, but that's pure speculation on my part.

PS: The User Control Panel provides you with a list of all your uploads (Overview » Manage attachments).
Post Reply