Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

image upload

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


zdravko.balorda at siix

Jan 16, 2012, 6:44 AM

Post #1 of 9 (1299 views)
Permalink
image upload

Hi,
how on earth one can get such a message:

Error retrieving data from image.
upon calling:
$superg->upload_file($fh, "superg.js");

It crashes at Bric::App::MediaFunc::_get_image_info().

Even deleting and reloading $superg media doesn't help.
It's just a json object, nothing fancy, that I need to
update from template.

Any help very wellcome. Thanks, Zdravko.


bret at pectopah

Jan 16, 2012, 6:49 AM

Post #2 of 9 (1237 views)
Permalink
Re: image upload [In reply to]

Hi Zdravko,

Bric::Biz::Asset::Business::Media::Image only likes actual image files.

If you're creating media assets using other file types, such as JSON,
you should use a Bric::BiZ::Asset::Business::Media object instead.

Hope this makes sense,

Bret

On Mon, 2012-01-16 at 15:44 +0100, Zdravko Balorda wrote:
> Hi,
> how on earth one can get such a message:
>
> Error retrieving data from image.
> upon calling:
> $superg->upload_file($fh, "superg.js");
>
> It crashes at Bric::App::MediaFunc::_get_image_info().
>
> Even deleting and reloading $superg media doesn't help.
> It's just a json object, nothing fancy, that I need to
> update from template.
>
> Any help very wellcome. Thanks, Zdravko.
>
>

--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


bret at pectopah

Jan 16, 2012, 6:49 AM

Post #3 of 9 (1253 views)
Permalink
Re: image upload [In reply to]

Hi Zdravko,

Bric::Biz::Asset::Business::Media::Image only likes actual image files.

If you're creating media assets using other file types, such as JSON,
you should use a Bric::BiZ::Asset::Business::Media object instead.

Hope this makes sense,

Bret

On Mon, 2012-01-16 at 15:44 +0100, Zdravko Balorda wrote:
> Hi,
> how on earth one can get such a message:
>
> Error retrieving data from image.
> upon calling:
> $superg->upload_file($fh, "superg.js");
>
> It crashes at Bric::App::MediaFunc::_get_image_info().
>
> Even deleting and reloading $superg media doesn't help.
> It's just a json object, nothing fancy, that I need to
> update from template.
>
> Any help very wellcome. Thanks, Zdravko.
>
>

--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


zdravko.balorda at siix

Jan 16, 2012, 7:00 AM

Post #4 of 9 (1240 views)
Permalink
Re: image upload [In reply to]

Bret Dawson wrote:
> Hi Zdravko,
>
> Bric::Biz::Asset::Business::Media::Image only likes actual image files.
>
> If you're creating media assets using other file types, such as JSON,
> you should use a Bric::BiZ::Asset::Business::Media object instead.
>
> Hope this makes sense,

It does, but $superg comes from:

% my ($superg) = Bric::Biz::Asset::Business::Media->list({ title => 'superg.js',
% 'site_id' => $story->get_site_id })

So, is here the $superg of proper type to run $superg->upload_file($fh, "superg.js")?

Regards, Zdravko


david at justatheory

Jan 16, 2012, 9:17 AM

Post #5 of 9 (1236 views)
Permalink
Re: image upload [In reply to]

On Jan 16, 2012, at 7:00 AM, Zdravko Balorda wrote:

> It does, but $superg comes from:
>
> % my ($superg) = Bric::Biz::Asset::Business::Media->list({ title => 'superg.js',
> % 'site_id' => $story->get_site_id })
>
> So, is here the $superg of proper type to run $superg->upload_file($fh, "superg.js")?

You sure about that? What does `ref $superg` show?

David


zdravko.balorda at siix

Jan 16, 2012, 11:54 PM

Post #6 of 9 (1247 views)
Permalink
Re: image upload [In reply to]

David E. Wheeler wrote:
> On Jan 16, 2012, at 7:00 AM, Zdravko Balorda wrote:
>
>> It does, but $superg comes from:
>>
>> % my ($superg) = Bric::Biz::Asset::Business::Media->list({ title => 'superg.js',
>> % 'site_id' => $story->get_site_id })
>>
>> So, is here the $superg of proper type to run $superg->upload_file($fh, "superg.js")?
>
> You sure about that? What does `ref $superg` show?
>
> David
>
>

Indeed, it says: Bric::Biz::Asset::Business::Media::Image:

Please, help me converting this.

Zdravko


david at justatheory

Jan 17, 2012, 9:24 AM

Post #7 of 9 (1237 views)
Permalink
Re: image upload [In reply to]

On Jan 16, 2012, at 11:54 PM, Zdravko Balorda wrote:

> Indeed, it says: Bric::Biz::Asset::Business::Media::Image:
>
> Please, help me converting this.

Whatever media element type that is, you have the Image checkbox checked. Uncheck it. Then you'll need to delete that media document and create a new one.

Best,

David


zdravko.balorda at siix

Jan 17, 2012, 10:07 PM

Post #8 of 9 (1232 views)
Permalink
Re: image upload [In reply to]

David E. Wheeler wrote:
> On Jan 16, 2012, at 11:54 PM, Zdravko Balorda wrote:
>
>> Indeed, it says: Bric::Biz::Asset::Business::Media::Image:
>>
>> Please, help me converting this.
>
> Whatever media element type that is, you have the Image checkbox checked. Uncheck it. Then you'll need to delete that media document and create a new one.
>

What do you mean by Image checkbox? It's Bricolage 2.0.

Regards, Zdravko


david at kineticode

Jan 17, 2012, 10:58 PM

Post #9 of 9 (1240 views)
Permalink
Re: image upload [In reply to]

On Jan 17, 2012, at 10:07 PM, Zdravko Balorda wrote:

>> Whatever media element type that is, you have the Image checkbox checked. Uncheck it. Then you'll need to delete that media document and create a new one.
>
> What do you mean by Image checkbox? It's Bricolage 2.0.

Sorry, not a checkbox. That’s what I get for trying to go from memory.

So you should have a bunch of element types in Admin -> Publishing -> Element Types. One of these is the type of your media document. When you created it, you selected what its content type would be. This would be one of Subelement, Story, Image, Audio, Video, or Other Media. This element type is clearly an Image.

So you need to use or create another element type with its content type set to Other Media. I usually call it something like “static files” or something, and use it for my CSS files, JavaScript files, etc. Then recreate your JSON media document as an instance of that type. You will likely need to delete the existing JSON media document if you want its URL.

HTH,

David

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.