# New Asset Management Extension

**URL:** <https://www.ruby-forum.com/t/new-asset-management-extension/80609>\
**Category:** Radiant CMS\
**Created:** [December 29, 2006, 5:58am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609 "2006-12-29T05:58:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [December 29, 2006, 5:58am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609/1 "2006-12-29T05:58:59Z")

</div>

I’ve been toiling away at another Asset Management extension -  
originally I started just playing round with Keith’s extension, but I’m  
pretty much dumped all that code now.

[http://soxbox.no-ip.org/radiant/svn/extensions/part\_assets](http://soxbox.no-ip.org/radiant/svn/extensions/part_assets)

This extension requires that you’re running on the mental branch, and  
that you also have my admin\_parts extension installed:

[http://dev.radiantcms.org/svn/radiant/branches/mental/](http://dev.radiantcms.org/svn/radiant/branches/mental/)  
[http://soxbox.no-ip.org/radiant/svn/extensions/admin\_parts](http://soxbox.no-ip.org/radiant/svn/extensions/admin_parts)

Features of this extension:

- Images are linked to each page, rather than being global.

- Images can be manipulated using FlexImage  
([http://beautifulpixel.com/flex\_image/index.html](http://beautifulpixel.com/flex_image/index.html)). Just dump a  
transform\_name.flexi file into ‘app/views/assets’ and you can transform  
images:

There’s also a default.flexi that all images are passed through - these  
files contain just ruby code and get passed both the @asset and the  
owning @page, so you could do default transformations depending on the  
type of page involved.

If FlexImage isn’t installed, the extension can continue to be used as a  
basic asset management system.

This isn’t complete. I don’t have:  
- a way to upload images for a page that hasn’t been created  
yet.  
- a nice way to delete images  
- much in the way of validation  
- anything in the way of tests (it’s probably going to crash  
early and often)  
- any caching whatsoever (your CPU will likely get choked if you  
try running this in production with transforms under even slight load)  
- any confidence that it wont destroy all your data or kill your  
first born child (use at own risk)

I’m pretty excited about how this extension is turning out - I’d love  
some feedback, and any offers of patches are always welcome.

Dan.

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [December 29, 2006, 6:03am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609/2 "2006-12-29T06:03:00Z")

</div>

Oh, and if you play with this, be aware that I reserve the right to  
completely change it in an incompatable manner (I’m thinking in  
particular of the way in which the assets are stored on the filesystem).

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [December 30, 2006, 12:36am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609/3 "2006-12-30T00:36:24Z")

</div>

Great stuff Daniel, looking forward to playing more with the  
FlexImage stuff after the new year. Hadn’t heard of it before, looks  
pretty cool!

In the meantime the only thing that jumped out at me were some  
missing icons 😉 Attached some BeOS icons I used in case said icons  
don’t really exist yet (they’re in png, not jpg)

-jamie

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [January 22, 2007, 10:00am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609/4 "2007-01-22T10:00:36Z")

</div>

nice work bud, i am playing with it now, i might help out with some of  
it in a week or two when im done trying to implement it.

---

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [January 2, 2007, 7:11am UTC](https://www.ruby-forum.com/t/new-asset-management-extension/80609/5 "2007-01-02T07:11:01Z")

</div>

I’ve progressed on my asset management extension.

Further updates will be available at:

```
http://soxbox.no-ip.org/radiant

```

I’ve now finished:  
- a way to upload asset for a page that hasn’t been created yet.

```
If you upload an asset and subsequently don't save the page,

```

it’s still  
left orphaned though (probably just have a rake task to clean.

```
- Caching. Currently using the exact same mechanism as the rest

```

of radiant  
(ie. 5 minute expiry and stored in yaml files). Not the best  
approach for  
either large assets or manipulated images.

So that leaves:

```
- a nice way to edit/delete images
- validation
- tests
- confidence that you can use this without screwing up your

```

data/life/mind.

Original announcement:

[http://soxbox.no-ip.org/radiant/articles/2007/01/02/page-asset-managemen](http://soxbox.no-ip.org/radiant/articles/2007/01/02/page-asset-managemen)  
t/
