[ansel] script cleanup

Ben Chavet ben at chavet.net
Thu Jun 3 06:26:39 PDT 2004


This code is in the image constructor:

             if (!empty($image['type'])) {
                  $this->data['type'] = $image['type'];
             }

So, yes and no...depends on whether the image parameters has a type defined.
This has been there for as long as I can remember.

--Ben

Quoting "Heath S. Hendrickson" <heath at outerspaceconsultants.com>:

> Ben Chavet wrote:
>
>> A while ago, I committed a touch_galleries.php script to ansel.  
>> Turns out, it
>> "touched" the images, too & gave them all of the gallery attributes. 
>>  This adds
>> a lot of unnecessary bloat to the database.  This SQL command:
>>
>> delete from horde_datatree_attributes where datatree_id in (select 
>> datatree_id
>> from horde_datatree_attributes where attribute_name='type' and
>> attribute_value='image/jpeg') and (attribute_name='thumbnail_width' or
>> attribute_name='thumbnail_height' or attribute_name='image_width' or
>> attribute_name='image_height' or attribute_name='default' or
>> attribute_name='default-type' or attribute_name='num-images' or
>> attribute_name='date-created' or attribute_name='last-modified');
>>
>> worked for me to clean up my horde_datatree_attributes table.  Use 
>> it at your
>> own risk...
>>
>> --Ben
>>
>
> Ben,
>
> MySQL <4.1 doesn't allow subselect queries... you have to do it as a
> left join.
>
> What I found interesting was that I only had a handful of datatree_id's
> that had type=image/jpeg.  Is that attribute a recent addition to
> Ansel?  Should it be set for all images in the datatree?
>
> h
>
> h




More information about the ansel mailing list