Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-04-06 05:08:52
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
file size limit for images - workarounds?
I have a need for making available medium- to high-resolution images – where the user can see a thumbnail, and if they wish to get the image, they click the thumbnail and the full-size image loads in the browser or can be downloaded
is it correct that Txp’s image uploading facility is restricted in size to ~1Mb? (or is it due to server variables?)
in the interim, I’m uploading these images as files, but obviously can’t have an associated thumbnail
am I missing anything? any suggested workarounds?
Offline
#2 2006-04-06 06:22:48
- whatbrick
- Member
- From: Texas
- Registered: 2006-03-13
- Posts: 100
Re: file size limit for images - workarounds?
As far as I know, PHP is limited to a 2MB file upload size by default. So, TXP itself has that same limit. There are ways to get around that, but it requires access to either the php.ini file, or (if your web host allows it) you can change that variable through the .htaccess file.
To associate the file with a thumbnail, that depends on how you are output the thumbnails. I use articles to display image galleries, with excerpts holding the thumbnail and the full article containing the full image, the image description/comments, and any other data I want to show. That allows me to use the custom_fields for whatever I need. Using this method I could either use a cusotm_field to hold the file ID that I need for each image, or just hardcode the file download link in each article.
Your method may differ.
Do not taunt the Markup Monkey!
Offline
#3 2006-04-06 07:53:40
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: file size limit for images - workarounds?
okay, maybe I misunderstood this bit in the Txp help:
Maximum Upload Size
.
Here you can restrict the maximim size (in bytes) for file uploads. Note that this value is also limited by the configuration of PHP. If Textpattern detects that your PHP configuration only allows smaller downloads it will automatically correct this value downwards. If you want to allow larger file uploads via upload from the browser you have to talk with your host. (The relevant values in php.ini are post_max_size, upload_max_filesize and memory_limit.)
.
Note: Image Uploads are not restricted by this value. The maximum allowed size for images is always ~ 1MB (unless restricted by PHP as explained above).
does that last paragraph mean max image size is always approximately 1MB?
just want to confirm there’s no Txp inbuilt limit on image size before asking systems administrator to change php.ini for me …
definitely want to use article images, to associate these photos with a particular story – but also mindful that the process needs to be reasonably intuitive for the end-user, so something like upm_img_picker or similar will be necessary… but that’s easy enough
Offline
#4 2006-04-06 08:35:13
- whatbrick
- Member
- From: Texas
- Registered: 2006-03-13
- Posts: 100
Re: file size limit for images - workarounds?
Ah, ok. I didn’t know they restricted it through TXP. What they did was put a hidden form field that restricts to file size to 1MB (actually, it’s a bit less than 1MB). The only way to change that is to change the function that creates the form, which is located under textpattern/lib/txplib_html.php
, line 372. It’s the function called upload_form
. In that function you’ll see this: $max_file_size = '1000000'
which you can change to match the PHP size limit (which would be 2048000, if it’s a 2MB limit). Easily done, but you’d have to do it each time you updated TXP.
Note: These are just my findings from poking around the TXP code. I’m not sure if there are other places that need changing, though I’m sure more knowledgible voices will speak up. :)
Last edited by whatbrick (2006-04-06 08:39:24)
Do not taunt the Markup Monkey!
Offline
#5 2006-04-06 08:39:12
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: file size limit for images - workarounds?
Whatbrick was faster with answering than me … :)
Offline
#6 2006-04-06 08:43:52
- whatbrick
- Member
- From: Texas
- Registered: 2006-03-13
- Posts: 100
Re: file size limit for images - workarounds?
…and I was right about more knowledgible voices. That’ll teach me to not use the search feature. :)
Do not taunt the Markup Monkey!
Offline
#7 2006-04-06 09:00:54
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: file size limit for images - workarounds?
thanks whatbrick & alexandra
I did search first but not well enough
Offline
#8 2006-04-06 09:28:13
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: file size limit for images - workarounds?
never mind nardo :) searching the txp forum is usually unstable as far as i noticed. actually your questions answer should be found on TextBook. Don´t know if it was added but if not may be one you could add it? Your english is better than mine :)
Offline
#9 2006-04-06 23:39:01
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: file size limit for images - workarounds?
no probs alexandra, but I’m not sure where it would be appropriate in TextBook …
Offline