38 of 39
38
File
Posted: 16 September 2008 11:17 AM   [ Ignore ]   [ # 667 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  404
Joined  09-09-2006

Tom - thanks very much for this. A great help!

 Signature 

Shape Shed | Usable, elegant web design, London, UK
Twitter | Flickr | LastFm | Blog | EE addons

Profile
 
 
Posted: 20 September 2008 06:52 PM   [ Ignore ]   [ # 668 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  02-16-2005
slapshotw - 29 August 2008 08:46 AM

Let’s take it off this thread. PM me.

How come you “took it off the thread”? I’m having the same problem (no output) and would have liked to hear the answer you gave.

Profile
 
 
Posted: 20 September 2008 07:02 PM   [ Ignore ]   [ # 669 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  02-16-2005

I need to see a real-world working example of template tags for Mark Huot’s File extension.

I have successfully uploaded an image with the extension, and verified that the file is on the server. The name of the custom File field is “news_image_1”. Here’s my template code:

{exp:weblog:entries}

{title}

{body}

{news_image_1 backspace=“6”}
{if file_path}{file_path}
{/if}
{if file_thumb_path}{file_thumb_path}
{/if}
{/news_image_1}

{/exp:weblog:entries}

I get the title and body fields outputted fine, but nothing else at all. The “File” template tags are right from the extensions docs. Any idea what’s wrong? EE 1.6.4, PHP 5.2.6. Thanks.

Profile
 
 
Posted: 20 September 2008 10:24 PM   [ Ignore ]   [ # 670 ]  
Summer Student
Avatar
Total Posts:  18
Joined  03-14-2008

{exp:weblog:entries weblog=“weblogname” limit=1}
{image_upload_field_name}
{/exp:weblog:entries}

Will yield something like…

/images/uploads/imageyouuploaded.jpg

I then use this scrap of info with phpthumb to resize to whatever I need.

Profile
 
 
Posted: 20 September 2008 11:10 PM   [ Ignore ]   [ # 671 ]  
Summer Student
Avatar
Total Posts:  18
Joined  03-14-2008

Now to my problem.  cool smile

Images uploaded are being converted from nice pretty jpegs to crunchy gifs, making them HUGE files and ugly. The dimensions also seem to be

I don’t get it.

Here’s an image I uploaded…

http://dev.conary.org/images/bighead.jpg

And this is what was generated on the server.


http://dev.conary.org/images/uploads/bighead1.jpg

Note that it’s both being resized to the maximum image size set in the upload prefs and that it is now a GIF. It ballooned from 216k to nearly 3mb in the process.

Ideas?!!??

Profile
 
 
Posted: 21 September 2008 01:32 AM   [ Ignore ]   [ # 672 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  323
Joined  03-18-2007
spacewalk - 20 September 2008 06:52 PM

How come you “took it off the thread”? I’m having the same problem (no output) and would have liked to hear the answer you gave.

This thread is already 38 pages, and I didn’t think having essentially a 1-on-1 conversation in it was helping the whole community anymore. The person was using the extension incorrectly—it wasn’t a problem with the extension. Just trying to keep the thread as clean as possible.

Did scottmoa‘s post help?

Scottmoa:

scottmoa - 20 September 2008 11:10 PM

Images uploaded are being converted from nice pretty jpegs to crunchy gifs, making them HUGE files and ugly.

Does making the following change in the extension code help?

Change From:

if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

Change To:

if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

Profile
 
 
Posted: 21 September 2008 10:12 AM   [ Ignore ]   [ # 673 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  02-16-2005

Regarding the length of this forum topic: This is what Mark Huot gives as the “support” link in his docs for the File extension. So obviously his original intention was to keep the whole discussion here. I completely agree that it’s unwieldy at this point. Mark should handle support a different way, but apparently he’s not supporting the extension anymore at all—as evidenced by his absence from the discussion of the JPEG mangling bug; a bit more on that below.

I was getting no output because I wasn’t wrapping his “custom field” tag in an HTML image tag. But his docs don’t say to do that, and I’m not a mind reader about what someone’s code does and doesn’t do. So, if you want an image to appear, you need an HTML image tag. However, if you’re using the “File” extension to allow the upload of ALL file types, not just images, then obviously you DON’T want to wrap your “File” field tag in an image tag. But I’m not dealing with that scenario here.

Here’s what works if you’re just trying to upload and resize an image, and then use it in a posting—which probably covers 90% of people. In this example, my weblog is named “news” and my custom “File” field is named “news_images”. If you have your “File” field set to allow multiple uploads, the following code will output all of them; if not, it will just output the single image you’ve allowed people to upload. Obviously, in addition to the HTML image tag I have here, you’ll do HTML for other fields (like title and body) and you’ll handle your CSS any way you want (I have inline CSS for this example):

{exp:weblog:entries weblog="news"}
    {news_images}
        
<img src={file_url} style="float: right; margin: 10px 20px; border: none;" />
    
{/news_images}
{
/exp:weblog:entries}

(BTW, to make this Forum post work, I had to use HTML entities for the left and right angle brackets of the image tag in the code above, otherwise my img src and the contained {file_url} wouldn’t show up; can’t that be fixed in these Forums?)

If, in Admin > Weblog Administration > File Upload Preferences (where you define your special upload destination), you have “Keep Original” set to “yes”, then you need to use {file_thumb_url} in the image tag above, NOT {file_url} because {file_url} will be for the original uploaded (and possibly gigantic) image file and {file_thumb_url} will be for the resized version that the “File” extension creates upon upload.

Regarding the bug where the “File” extension turns JPEGs into nasty GIFs masquerading as JPEGs: the bug is definitely there in “File” extension v.3.1.1, and the fix here works. Here’s another thread from these Forums where it’s also mentioned that you can control the quality of JPEG created:

http://expressionengine.com/forums/viewthread/72506/#447569

Profile
 
 
Posted: 21 September 2008 10:18 AM   [ Ignore ]   [ # 674 ]  
Grad Student
Rank
Total Posts:  77
Joined  11-18-2007

Hi @ all

1. I can’t see the “Remove”-check box in the CP. JS is active, cause I’m using some jQuery in the front&back;-end.

and

2. if I use this extension only for uploading images, is there a chance to assign a caption to each image? (I know, there is a way with reverse related entries)

cheers

Profile
 
 
Posted: 21 September 2008 11:04 AM   [ Ignore ]   [ # 675 ]  
Grad Student
Avatar
Rank
Total Posts:  75
Joined  02-16-2005

1) What exactly are you *doing* with jQuery that’s intefering? The mere inclusion of the jQuery framework (with a script tag in your page head) should not be doing anything to the display of those checkboxes.

2) I see no capability in the “File” extension itself for this. For single images only, you could easily define an additional field in your field group, put the caption there, and then bring that field in with your HTML. If you’re using the extension for multiple file upload, I see no obvious captioning solution. Anyone else?

Profile
 
 
Posted: 21 September 2008 01:14 PM   [ Ignore ]   [ # 676 ]  
Grad Student
Rank
Total Posts:  77
Joined  11-18-2007

1. i’m using Leevi’s Poll Extension, wich does work with jQuery. Even the CP got it loaded. Probably Mark’s extension works with prototype, or?

2. Yeah… I guess there is nothing outside. Probably there is the chance to code it on a funded base. There are heaps of threads who looking for a “weblog gallery” solution not a gallery, nothing reverse related entries, etc..

Nice would be file-uploading via Mark Hout’s ext. optional add caption and all ajax based. but i know, there is a hassle about the how to for a good workflow.
I’m using the fckeditor in backend and frontend. wich works great. I saw a plug-in (badly no link provided) to use templates in fckeditor for input images, caption and alterante text.
Should we move this to a new thread?

Stefan

Profile
 
 
Posted: 21 September 2008 05:42 PM   [ Ignore ]   [ # 677 ]  
Summer Student
Avatar
Total Posts:  18
Joined  03-14-2008
slapshotw - 21 September 2008 01:32 AM

Scottmoa:

scottmoa - 20 September 2008 11:10 PM

Images uploaded are being converted from nice pretty jpegs to crunchy gifs, making them HUGE files and ugly.

Does making the following change in the extension code help?

Change From:

if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

Change To:

if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

Excellent!
That appears to have solved the jpeg/GIF conversion issue. thank you!

Now I only have one issue - it’s still resizing it to the maximum image size set in the upload prefs. Ideally, it shouldn’t touch it at all if the image is within those parameters. This resizing is both increasing the file sizes and, as you know, with each manipulation there’s a drop in image quality.

Any guesses?

In the mean time, I’ve simply removed the maximum dimensions to prevent any resizing.

*thank you* for your assistance.

Profile
 
 
Posted: 23 September 2008 02:12 PM   [ Ignore ]   [ # 678 ]  
Grad Student
Rank
Total Posts:  64
Joined  01-05-2008

Wow this thread is really long eh? (If this question has already been answered on this thread I apologize)

It sounds like when a file is uploaded using the ‘file’ extension, that it automagically creates thumbnails for those images.  Mine doesn’t seem to be doing that, is there a setting that I need to set? I imagine that in my upload directory there should be the image I uploaded and a thumbnail of it.  (I’m not seeing any thumb files) 
It shows thumbs when I am editing weblog entries, but when I call the {file_thumb_url} variable, it doesn’t link to anything.  Does it matter what kind of image file I upload, jpg or gif?

Here’s some code I use to call the thumb image:
{exp:weblog:entries weblog=“portfolio” limit=1 dynamic=“off” status=“Featured”}

{portfolio-main-image}
{file_thumb_url}<br>
{/portfolio-main-image}

{/exp:weblog:entries}

Sorry if this is really obvious and really long winded.

-kev

Profile
 
 
Posted: 01 October 2008 08:13 AM   [ Ignore ]   [ # 679 ]  
Lab Assistant
RankRank
Total Posts:  140
Joined  09-06-2006

Why can’t I get this multi file to work?

I have multi images enables in the prefs my code is

{exp:weblog:entries weblog="missions" category="7"}
{missiongallerys}
<img src="{missiongallery}" alt="Mongolia" width="250"border="0"/> </a>{/missiongallerys}
             {
/exp:weblog:entries}


missiongallery is my custom field.

when it is outputted only the first image appears as well as in the browser {missiongallerys} {/missiongallerys}

ie: this is the source or the outputted page

{missiongallerys} <img src="http://domain.org/images/uploads/1.jpg" width="250"  border="0"/>{/missiongallerys}

If I upload 4 images and I use this code below everything works except I just get the same first image 4 times.

{exp:weblog:entries weblog="missions" category="7"}
{missiongallery}
<img src="{missiongallery}" alt="Mongolia" width="250"border="0"/> </a>{/missiongallery}
             {
/exp:weblog:entries}

So it appears adding the “s” to make it plural which I thought was the trick in using multiple images breaks everything.

Profile
 
 
Posted: 01 October 2008 01:48 PM   [ Ignore ]   [ # 680 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  141
Joined  11-19-2007

I wanted to discuss improvements and customizations but this thread got a little too long.

I created this new thread for discussing advanced use of Mark Huot File Extension.

Please come over if you have feature requests, customization tips, etc

 Signature 

http://www.bbook.com

Profile
 
 
Posted: 14 October 2008 07:41 PM   [ Ignore ]   [ # 681 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  201
Joined  12-16-2006

I read about 50% of this thread and didn’t find a problem or solution similar to what I’m experiencing on a client site. During development on our own server File worked like a charm. However, we moved the dev site to production on the client’s server last week and now File doesn’t work. Specifically, the file/image doesn’t get uploaded to the server. I confirmed this by looking via FTP.

Of course, I checked, double-checked and triple-checked all settings. Everything is correct. Previous images that were uploaded on the development site are showing just fine on the live/production site. I should mention this live site is hosted at GoDaddy (yeah, I know…).

Also, I checked the regular file upload that comes with EE and that works as its supposed to. It’s definitely something with File. Can someone please help? I have no idea what the difference may be or where to start troubleshooting.

.angie

 Signature 

420 Design - web design + development | EE Pro Network Member

Profile
 
 
Posted: 14 October 2008 10:14 PM   [ Ignore ]   [ # 682 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  141
Joined  11-19-2007
.angie - 14 October 2008 07:41 PM

Previous images that were uploaded on the development site are showing just fine on the live/production site.

Usually when this happens, your paths are still pointing to other server. So you move the files over, move the database, but unless you change the upload paths, the images are going to come from original server.

I move databases from dev, to staging, to production, and vice versa all the time. I have no problems.

What we choose to do is: never move DB from dev to production. Always from production to dev. So when I custom fields for example, I create them on production, export the DB and import it into dev. Then I go over the paths to point at dev. This way you can never break production.

Take a look at the images I uploaded. One is production settings and the other one is dev settings.

The third is the custom field settings.

Hope this helps.

Image Attachments
Picture-21.jpgPicture-20.jpgPicture-16.jpg
Click thumbnail to see full-size image
 Signature 

http://www.bbook.com

Profile
 
 
Posted: 15 October 2008 02:40 PM   [ Ignore ]   [ # 683 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  201
Joined  12-16-2006
bkuberek - 14 October 2008 10:14 PM

Usually when this happens, your paths are still pointing to other server. So you move the files over, move the database, but unless you change the upload paths, the images are going to come from original server.

Very true. And I checked that thoroughly because I’ve had that little bit bite me in the rear before. But apparently something wasn’t right… I just checked things today and everything’s working. In all the checking and editing I must have changed something to the right setting. Guess a good night’s sleep is better than anything after all. smile

 Signature 

420 Design - web design + development | EE Pro Network Member

Profile
 
 
Posted: 17 October 2008 09:00 AM   [ Ignore ]   [ # 684 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  363
Joined  02-25-2008

Mark,

I really like the nice interface and ease of use. Is there anyway to leverage this to associate files on the server that have been uploaded by ftp? If not, are you aware of any other options for doing so?

Thanks,

Forrest

 Signature 

Rouviere Media — Building Expression Engine Sites. Based in Raleigh, NC Area .

Profile
 
 
   
38 of 39
38
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64878 Total Logged-in Users: 73
Total Topics: 81804 Total Anonymous Users: 43
Total Replies: 439750 Total Guests: 304
Total Posts: 521554    
Members ( View Memberlist )
Newest Members:  pticketdxrsmdanbilly8hrkiliwysso50kexpressoKlaasdarrenstylestravelerjcaton