34 of 39
34
File
Posted: 21 July 2008 01:12 PM   [ Ignore ]   [ # 595 ]  
Grad Student
Rank
Total Posts:  54
Joined  02-07-2006

For anyone having problems using this with MSM, check out this post

The problem is most likely to come up if you duplicated a site that uses the extension.

Profile
 
 
Posted: 25 July 2008 07:16 AM   [ Ignore ]   [ # 596 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1562
Joined  08-02-2006

Hi,

I’m trying to get this extension to work and have been successful with new images, but cannot figure out what’s needed to make it play nice with already existing images.

I’m using a weblog as a gallery and all of my existing images have been uploaded the usual way inside of the EE publish page and I’ve selected “Insert URL” as the setting when uploading. To display the image I’m using:

{exp:imgsizer:size src="{gallery-image}" width="130" height="130" alt="{gallery-image-name} - {gallery-image-description}"}

When I go back in and look at the existing entries inside of my “gallery” weblog, it shows the correct file name for that “file” custom field but it has that same {filedir_X} appended to the beginning of the file name and I noticed that when uploading a new image it does not have the {filedir_X} appended to the front of the file name. I assume this is because you have to manually specify and upload destination for each file custom field so it already “knows” where the image is stored thus the extra URL info is not needed?

Thoughts on how to get my existing images to work?

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 27 July 2008 12:19 AM   [ Ignore ]   [ # 597 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Deron,

I’m confused on what you’re trying to do here. The file field can’t access already existing images as far as I know. It has nothing to do with galleries. You just upload the file using the custom field, and it uploads it to the directory you set using the settings you’ve entered. If you don’t upload a file while in a specific entry, it has no way of knowing which entry each pre-exiting file is associated with.

Does that help?
-Matt

Profile
 
 
Posted: 27 July 2008 09:14 AM   [ Ignore ]   [ # 598 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1562
Joined  08-02-2006

Hi Matt,

Sorry for the confusion. wink I realize it doesn’t have anything to do with galleries, but I was attempting to explain my setup. I’ve created a gallery (a few months ago) using a the weblog as a gallery method (instead of the gallery module).

I was able to get the File extension to work perfectly when creating a new entry with picture upload. What I wasn’t able to figure out (and this may not be possible, but what I’m trying to figure out) is if there is a way to change all existing images in my gallery over so that they work with the File extension? By going into my weblog administration custom field settings and changing my image custom file from “text input” to “File” type, this makes all of my existing images not work and I’m just looking for a way to fix that without going in and re-uploading all of the existing images.

Thoughts?

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 27 July 2008 01:07 PM   [ Ignore ]   [ # 599 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Now I understand! Unfortunately I don’t think there’s a way to easily do it, but you may be able to do it with some clever SQL conversions. As far as I know, File stores the picture path information in the database as a text string, delimiting with \r between a file and it’s thumbnail, and \n between different files. There’s also a \r at the end of the string in a File field set for multiple = yes. So, it may be worth writing SQL to fill out the file field automatically given the database entries for the other field. Make sure to play around on a database copy before doing anything on your production one though!

The other thing to consider is just making File a new field, and using a conditional statement in your template to see if the image is there using File, or the gallery field.

Does that help at all?

-Matt

Profile
 
 
Posted: 27 July 2008 07:57 PM   [ Ignore ]   [ # 600 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1562
Joined  08-02-2006

Matt,

Yep, that helps out a lot! I might give the conditional statement route a try because the words “clever” and “SQL” aren’t in my vocabulary. I know zero SQL. wink

Thanks for your help.

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 27 July 2008 10:36 PM   [ Ignore ]   [ # 601 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

No problem. I use a conditional with File in my templates all the time. If your FIle custom field is named imageUpload, you can do:

{if imageUpload != ""}{imageUpload}{file_thumb_url}{/imageUpload}{/if}

One piece of advice: don’t use if:else with them, only simple {if}{/if} conditionals (you can use {if imageUpload != “”}foo{/if}{if imageUpload == “”}bar{if}). I’ve seen weirdness when using the advanced conditionals with it.

Profile
 
 
Posted: 28 July 2008 04:38 AM   [ Ignore ]   [ # 602 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  405
Joined  09-09-2006

Firstly to Mark Huot a big THANK YOU for publishing this extension. It is great.

I’ve got an issue that seems to have cropped up before but doesn’t seem to have found a resolution yet.

Via the First Party uploader I can upload images and resize them correctly and they output with the correct MIME type. Using the file extension I am coming across an issue where the resized file is resizing ok but taking the incorrect MIME type. So I’ve got a .jpg file with a MIME type of GIF. I’ve run a few tests and any image file uploaded gets the MIME type of GIF.

I’m using the GD2 Library for the resizing and have the following config in phpinfo()

GD Support     enabled
GD Version     bundled
(2.0.28 compatible)
FreeType Support     enabled
FreeType Linkage     with freetype
FreeType Version     2.2.1
GIF Read Support     enabled
GIF Create Support     enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support     enabled
XBM Support     enabled

I’m running this on Apache 2.2.3, PHP 5.1.6 on Centos 5.2

Looking through the extension code I’m not sure that MIME type gets set?

 Signature 

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

Profile
 
 
Posted: 28 July 2008 06:20 AM   [ Ignore ]   [ # 603 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1562
Joined  08-02-2006
slapshotw - 27 July 2008 10:36 PM

No problem. I use a conditional with File in my templates all the time. If your FIle custom field is named imageUpload, you can do:

{if imageUpload != ""}{imageUpload}{file_thumb_url}{/imageUpload}{/if}

One piece of advice: don’t use if:else with them, only simple {if}{/if} conditionals (you can use {if imageUpload != “”}foo{/if}{if imageUpload == “”}bar{if}). I’ve seen weirdness when using the advanced conditionals with it.

Good to know! Thanks for the heads up and info. wink

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 31 July 2008 05:40 AM   [ Ignore ]   [ # 604 ]  
Summer Student
Total Posts:  12
Joined  06-27-2008

Great extension - you’ve saved me a world of hassle with this - thanks!


Having a small problem in that the image resize method defaults to Auto all the time and I can’t seem to change it. I have Max Width and Min Width set, but every time I go back to the file upload preferences it still says Auto.

Is there a setting I’m missing? Everything else works fine.

Profile
 
 
Posted: 31 July 2008 10:03 AM   [ Ignore ]   [ # 605 ]  
Summer Student
Total Posts:  8
Joined  07-31-2008

Hello all,

I try to make transparent png thumbs but if they are created they have a black background
After a quick google i came on this: http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/

I’ve tried to edit the extension but with no luck.

Someone who can help me with this to get it working?
Thanks!

Profile
 
 
Posted: 31 July 2008 12:31 PM   [ Ignore ]   [ # 606 ]  
Summer Student
Total Posts:  8
Joined  07-31-2008

Hi people, me again, i have now this code (Check if this image is PNG, then set it to transparent):

//  =============================================
                    //  Create Destination Image
                    //  =============================================

                    
$dst_img = $create($dst_width, $dst_height);
                    
                    
//  =============================================
                    //  Check if this image is PNG, then set it to transparent
                    //  =============================================                    
                    
if(($src_img = @imagecreatefrompng($server_path.$file_name)) !== FALSE) {
                        imagealphablending
($dst_img, false);
                        
imagesavealpha($dst_img,true);
                        
$transparent = imagecolorallocatealpha($dst_img, 255, 255, 255, 127);
                        
imagefilledrectangle($dst_img, 0, 0, $dst_width, $dst_height, $transparent);
                    
}
                    
                    
//  =============================================
                    //  Copy SRC to DEST
                    //  =============================================
                    
$copy($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_width, $dst_height, $src_width, $src_height);
                    
                    
//    =============================================


Can somebody tell me what i’m doing wrong here?

Profile
 
 
Posted: 31 July 2008 06:05 PM   [ Ignore ]   [ # 607 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007
kevincannon - 31 July 2008 05:40 AM

Is there a setting I’m missing? Everything else works fine.

Are you seeing the settings listed here:

http://docs.markhuot.com/ee/extensions/file/

There’s a glitch in the extension where those settings can be hidden sometimes, and you have to set them via the database. Where are you setting auto?

-Matt

Profile
 
 
Posted: 02 August 2008 10:07 PM   [ Ignore ]   [ # 608 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  380
Joined  03-01-2006

Apologies if this has been asked before (but it’s a very long thread): is there a way to be able to upload files with the same name over the top of ones that already exist? By default it throws an error message about duplicate file names.

 Signature 

John Faulds - Tyssen Design | Member of EE Pro Network

Profile
 
 
Posted: 04 August 2008 04:25 AM   [ Ignore ]   [ # 609 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6544
Joined  04-15-2006

Hi Tyssen,

Well there are two things that you can do about that. One is that when you get the warning you can click on the check-box that appears at the top of the publish page and then choose the image / file again and re-upload it. You should then notice that the file now gets called the same name but with something like _1 appended to the end of the name before the file extension.

The other way is to use the option in the File extension to make it re-name all files for you anyway. This means that any file that gets uploaded is completely renamed and has loads of numbers and letters in its file-name. If you aren’t fussed about what the files are called then this is the absolute easiest way to go but if you are going to need to be able to find the images / files at a later date then this could cause problems. Both have their merits in one way or the other but totally depends on which way you need to use the files once they are uploaded.

Hope that helps.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 04 August 2008 04:32 AM   [ Ignore ]   [ # 610 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  380
Joined  03-01-2006

Not really, because I have one part of a site I’ve been working on where the navigation is based on the file name so it needs to be in the same format and if the client ever needs to replace a file, they should be able to upload a new one with the same name and replace the previous one (although they’re unlikely to do it very often and the files are on the large size, so it may just be easier to FTP new files over the top of the old ones).

 Signature 

John Faulds - Tyssen Design | Member of EE Pro Network

Profile
 
 
Posted: 04 August 2008 08:41 AM   [ Ignore ]   [ # 611 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Tyssen—why not delete the file using the extension, the reupload the new one? If it’s the same name your navigation should still work.

Profile
 
 
Posted: 04 August 2008 10:48 AM   [ Ignore ]   [ # 612 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6544
Joined  04-15-2006
slapshotw - 04 August 2008 08:41 AM

Tyssen—why not delete the file using the extension, the reupload the new one? If it’s the same name your navigation should still work.

That would have been my next suggestion but I wasn’t sure if the file you were trying to upload with the same name was in the same entry or not though?

If it is indeed in the same entry then no problem just go ahead and click on the remove check-box and then choose the new (same-named) image and everything should be fine. If the image / file is in another entry then you wouldn’t be able to do this as you wouldn’t be able to have two files of the same name in the same upload directory.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
   
34 of 39
34
 
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: 64920 Total Logged-in Users: 37
Total Topics: 81877 Total Anonymous Users: 21
Total Replies: 440165 Total Guests: 220
Total Posts: 522042    
Members ( View Memberlist )