# Images again

**URL:** <https://www.ruby-forum.com/t/images-again/105984>\
**Category:** Radiant CMS\
**Created:** [June 5, 2007, 9:47am UTC](https://www.ruby-forum.com/t/images-again/105984 "2007-06-05T09:47:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 9:47am UTC](https://www.ruby-forum.com/t/images-again/105984/1 "2007-06-05T09:47:34Z")

</div>

Hi again

I’ve followed the discussion about using page attachments for images  
with great interest, and finally we got it working too. However, because  
you can’t reference attachments from snippets or layouts, this doesn’t  
really seem like a good solution for images that reoccur throughout a  
website design (such as a logo or whatever). Surely there must be some  
way to reference static images somehow? I can’t find any documentation  
on this. Eg, is there some directory in a radiant project that will act  
as web root, or can one be created?

Thanks for any help,

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 10:07am UTC](https://www.ruby-forum.com/t/images-again/105984/2 "2007-06-05T10:07:37Z")

</div>

Il giorno 05/giu/07, alle ore 09:46, Johan Rönnblom ha scritto:

> Hi again
> 
> I’ve followed the discussion about using page attachments for  
> images with great interest, and finally we got it working too.  
> However, because you can’t reference attachments from snippets or  
> layouts, this doesn’t really seem like a good solution for images  
> that reoccur throughout a website design (such as a logo or whatever).

I use Gallery extension to do that…I usually create a gallery  
called Layout and I set it as hidden, so it doesn’t appear in the  
galleries list page. Then I use images with this tag:

\<r:gallery:item:path id=“GALLERY\_ID” position=“ITEM\_POSITION”/\>

…or…

\<r:gallery:item:thumb id=“GALLERY\_ID” position=“last” height=“200”/\>

if you want to read more check the README file here:

[http://darcs.bigchieflabs.com/radiant/extensions/gallery/rdoc/](http://darcs.bigchieflabs.com/radiant/extensions/gallery/rdoc/)

Ciao!

* * *

Andrea F.

removed\_email\_address@domain.invalid  
[http://bigchieflabs.com/blog/](http://bigchieflabs.com/blog/)  
[http://think.bigchief.it](http://think.bigchief.it)

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 1:13pm UTC](https://www.ruby-forum.com/t/images-again/105984/3 "2007-06-05T13:13:47Z")

</div>

Andrea F. wrote:

> I use Gallery extension to do that…I usually create a gallery  
> called Layout and I set it as hidden, so it doesn’t appear in the  
> galleries list page.

Ok. It seems the Gallery extension relies on having a lot of stuff  
installed though. Presumably the web root is in public/ and that just  
linking statically to some files there will work. Of course this  
requires access to put new files there, but that should not be a problem  
for ‘site-global’ content… so I guess we’ll use that and then get the  
attachments plugin when that works with a stable release.

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/images-again/105984/4 "2007-06-05T16:06:23Z")

</div>

Johan Rönnblom wrote:

> Hi again
> 
> I’ve followed the discussion about using page attachments for images with great interest, and finally we got it working too. However, because you can’t reference attachments from snippets or layouts, this doesn’t really seem like a good solution for images that reoccur throughout a website design (such as a logo or whatever). Surely there must be some way to reference static images somehow? I can’t find any documentation on this. Eg, is there some directory in a radiant project that will act as web root, or can one be created?
> 
> Thanks for any help,

Your only option with page attachments for site-wide images is to attach  
them to the root page. The current method for finding attachments is to  
search the current page and then the parent pages recursively.

Sean

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/images-again/105984/5 "2007-06-05T17:17:48Z")

</div>

On Jun 5, 2007, at 9:05 AM, Sean C. wrote:

> Your only option with page attachments for site-wide images is to  
> attach  
> them to the root page. The current method for finding attachments  
> is to  
> search the current page and then the parent pages recursively.
> 
> Sean

that’s a cool trick, but are the images available using the tag from  
within a layout with that method?

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/images-again/105984/6 "2007-06-05T18:17:58Z")

</div>

Yes, they are. A layout is never rendered without an associated page,  
so all the tags within a layout refer to that page when applicable.

Sean

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 6:41pm UTC](https://www.ruby-forum.com/t/images-again/105984/7 "2007-06-05T18:41:04Z")

</div>

The scope of 0.7 has not changed, but we have a lot of enhancements yet  
to do to 0.6, IMO. One major thing is the discovery and installation of  
extensions, half of which I wrote at RailsConf.

Asset management is an issue that I think everyone wants a different  
solution for. I primarily wanted to be able to put images in my blog  
posts and I liked the interface John had mocked up, so I emulated it  
with page\_attachments. Gallery takes a more asset-focused approach and  
makes it easy to display lots of images. It’s also pretty easy to  
roll-your-own. There’s power and flexibility in the diversity of  
approaches here, and I don’t think we’ve reached the ‘standardization’  
stage. In fact, in some ways I hope we never reach that – it could  
mean a hugely bloated piece of software. And there are better software  
out there for asset management than any extension in Radiant could  
achieve.

My $0.02.

Sean

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 5, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/images-again/105984/8 "2007-06-05T18:24:59Z")

</div>

What are the core plans for a new image manager? I have one I wrote,  
there is Sean’s and then the Gallery extension, but it seems like  
there should be some sort of official plugin. None these (mine for  
sure!) are really “ready for prime time” or all they all that they  
could be. This seems to be something that people need, the list has  
been flooded with questions in the last few weeks.

What is the “killer feature” of 0.7 in any case. 0.6 was extensions,  
which have worked out very well and opened things up a lot, but where  
do we go from here? Are “blogging” features still the main focus?

Keith B.  
Tel: +49-7731-79838380  
removed\_email\_address@domain.invalid  
[http://keithbingman.com](http://keithbingman.com)

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 3:17am UTC](https://www.ruby-forum.com/t/images-again/105984/9 "2007-06-06T03:17:38Z")

</div>

On 05/06/07 01:23 PM, Keith B. was heard to say:

> What are the core plans for a new image manager? I have one I wrote,  
> there is Sean’s and then the Gallery extension, but it seems like  
> there should be some sort of official plugin.

There is also the approach of abstracting the content and suddenly get  
a whole bunch of possible features:

[http://init.ca/blog/2007/04/02/abstract-content-model-for-radiant/](http://init.ca/blog/2007/04/02/abstract-content-model-for-radiant/)

Cheers,  
Oliver

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 4:15am UTC](https://www.ruby-forum.com/t/images-again/105984/10 "2007-06-06T04:15:52Z")

</div>

> What are the core plans for a new image manager? I have one I wrote,  
> there is Sean’s and then the Gallery extension, but it seems like  
> there should be some sort of official plugin. None these (mine for  
> sure!) are really “ready for prime time” or all they all that they  
> could be. This seems to be something that people need, the list has  
> been flooded with questions in the last few weeks.

I’m currently quietly (and very very slowly) building  
an asset management plugin hoping to encompass the  
features in both my original asset manager and sean’s  
manager. I’ve downloaded your extension and the gallery  
extension, but have yet to look through those to figure  
out if there’s any more features that are missing.

I’m hoping that I can come up with something that  
provides a core that everybody is happy with that.  
I’m not too worried about how it’s going to look  
in the view (I’ll probably make it look the same  
as my original extension), but if I can get the  
core of it right, changing how the view works  
can be up to debate and extensions.

Features that I’m planning are:

- Tests  
Loads and loads and loads of tests. I’m currently  
developing in in TDD style. This is the main reason  
why none of the other extensions can even be  
considered at the time being.

- Primary Storage is in the db as blobs:  
For ease of backup and replication and making  
sure we can scale horizontally. This was a  
debated issue when we first started discussing  
asset management, but I’m 100% convinced that  
this is the right answer, mainly because all  
the real arguments against are handled by:

- Serving through secondary storage:  
When pages are published or the assets of a  
published page are modified, the assets can  
be dumped either to the public dir, or  
possibly exported to s3 or another external  
location. The performance of radiant’s cache  
is good enough that this isn’t needed in the  
basic case, but for people who need a lot of  
performance from the assets, it needs to be  
there as an option.

- Degraded installation.  
It will work out of the box with no dependencies,  
but some features might require dependencies.

- Image manipulation  
My original extension allowed image manipulation  
using fleximage templates (to resize, add shadows,  
etc). I plan to have the same manipulations  
performed in a similar way to the way that tags  
are defined using a syntax similar to fleximage  
and degrading based on whether imagescience,  
rmagick or nothing is installed.

The work is going slowly. Very very slowly, as I just  
haven’t had the time to dedicate to it, and because  
the features that I’m putting in aren’t handled by  
the usual suspects (attachment\_fu and  
acts\_as\_attachments) - I believe that CMS asset  
management needs a bit more than what they provide.

Dan.

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 4:27am UTC](https://www.ruby-forum.com/t/images-again/105984/11 "2007-06-06T04:27:53Z")

</div>

Dan,

I’m thrilled to see “image manipulation” as one of your planned  
features. Can I put in a specific request – acknowledging that, as  
you said, this is moving slowly?

I’ve been hunting for a way to control thumbnail generation from  
within a gallery or asset management tool, and so far I haven’t found  
anything that quite fits my needs. What I’d like is to be able to  
upload an image for inclusion in a gallery, and either as part of the  
upload process, or afterwards, have the ability to crop the image to  
specify what portion to use for the thumbnail. I’ve found a number of  
Javascript cropping implementations, but I’m pretty new to Rails, and  
I’ve not been able to work out how I might put this to use in the  
context of Radiant.

Here’s one:

[http://www.defusion.org.uk/demos/060519/cropper.php](http://www.defusion.org.uk/demos/060519/cropper.php)

…and an inkling of how it might be implemented in something like  
the Gallery Extension:

[http://garbageburrito.com/blog/entry/135/javascript-image-cropping-](http://garbageburrito.com/blog/entry/135/javascript-image-cropping-)  
with-jscropperui-and-rails

Thanks!

\*DN

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 5:36am UTC](https://www.ruby-forum.com/t/images-again/105984/12 "2007-06-06T05:36:57Z")

</div>

My biggest gripe with most online photo management apps is that even  
if you have access to the server via FTP, you must individually  
select each file to upload. I can see Radiant excelling in this  
capacity with well designed rake tasks for whatever image extension  
takes the lead in this capacity.

Has anyone written a rake task to do a bulk import from the local  
server filesystem into the Gallery Extension? I’m planning on  
developing one myself (and then making it public, of course) if no  
such task already exists. But as a novice Ruby/Rake user, I’d like  
to make sure I’m not repeating anyone else’s work. 🙂

-Matt

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 5:04pm UTC](https://www.ruby-forum.com/t/images-again/105984/13 "2007-06-06T17:04:50Z")

</div>

On 6/5/07, Oliver B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Cheers,  
> Oliver

I just glanced over this, and I think it looks awesome. I don’t think  
I understand all the design decisions, but it definitely add lots of  
flexibility to the system, so I +1 this.

---

<div class="post-metadata">

**Author:** ![Johan\_RSSSSnnblom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/76d3ee/32.png) [@Johan\_RSSSSnnblom](https://www.ruby-forum.com/u/Johan_RSSSSnnblom)\
**Post date:** [June 6, 2007, 4:29am UTC](https://www.ruby-forum.com/t/images-again/105984/14 "2007-06-06T04:29:53Z")

</div>

Just to add: in the context of the broader discussion, I’d agree that  
Radiant needs a stable plugin for basic image handling.

For my own needs, the Gallery Extension, with the cropping feature in  
my previous message, would cover most situations.

\*DN
