The Entrepreneur Forum | Financial Freedom | Starting a Business | Motivation | Money | Success
  • SPONSORED: GiganticWebsites.com: We Build Sites with THOUSANDS of Unique and Genuinely Useful Articles

    30% to 50% Fastlane-exclusive discounts on WordPress-powered websites with everything included: WordPress setup, design, keyword research, article creation and article publishing. Click HERE to claim.

Welcome to the only entrepreneur forum dedicated to building life-changing wealth.

Build a Fastlane business. Earn real financial freedom. Join free.

Join over 90,000 entrepreneurs who have rejected the paradigm of mediocrity and said "NO!" to underpaid jobs, ascetic frugality, and suffocating savings rituals— learn how to build a Fastlane business that pays both freedom and lifestyle affluence.

Free registration at the forum removes this block.

programmers...need help, users uploading pictures to my site

theBiz

Silver Contributor
Speedway Pass
User Power
Value/Post Ratio
46%
Jul 9, 2009
1,162
535
NY
Hi i included a picture hopefully it will help make things alittle more clear.

I have a listing website, users can upload pictures.

Here is the problem... a user uploads a 1.6mb picture... right now that stays 1.6mb, then as far as the thumbnail goes that just gets compressed but it does not get resized so as you can image ... the search pages are loading slow and the thumbnail is actually 1.6mb.



How can i explain to my developer to do this, and do this properly...this is what i want it to do.

A user uploads a file that is 1.6mb> it immediately gets reformatted to a size much smaller something like 100kb.

Then it creates a thubnail for that picture which again is reformatted>somewhere around 30kb

The reason i say the thumbnail should be resized also is because if not it will remain the same file size as the new larger 100kb size and i see most good sites their thumbnails are around 30kb.

Maybe .png's, .bmps etc should immediately be reformatted into .jpg's and THEN make a shrunken smaller thumbnail?


thank you and i appreciate the help.

inst2.png
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

mcjon77

New Contributor
User Power
Value/Post Ratio
31%
Sep 5, 2011
51
16
Your explanation was decent. You also want to add the dimension boundaries that you want for the image (both the full size and the thumbnail). For instance, neither axis for the thumbnail should be more than 100 pixels.
 

theBiz

Silver Contributor
Speedway Pass
User Power
Value/Post Ratio
46%
Jul 9, 2009
1,162
535
NY
Thank you McJon for the response... Can you give me any details as far as the proper way to code this. I'm pretty sure I read somewhere the correct way was to have two folders one for the main pic and another for tue thumbnail.

How will he create something to reformat all pics to .jpg then make a thumbnail of it?

Also how does the platform makes sense of all of this? It must place the thumbnail in a different folder.. how does it keep track of which main picture in folder 1 should match up with the thumbnail version of itself in folder 2?


Geez I need to learn how to code.. I'm such a perfectionist, every coder hates me.
 

Icy

Contributor
User Power
Value/Post Ratio
11%
Feb 16, 2009
807
86
Didn't read through the whole article, but this may be a good place to start:

http://oswaldatwork.thetaoofamp.com/2009/10/scaling-images-in-php-done-right/


It's just a matter of scaling the image, which I've never had to explicitly do myself, but it cannot be that bad. Just describe it as scaling the image to the programmer.


Also how does the platform makes sense of all of this? It must place the thumbnail in a different folder.. how does it keep track of which main picture in folder 1 should match up with the thumbnail version of itself in folder 2?

Depends on how complex it'll be in the end, but I mean you could get by with simply having two directories, and have the files named the same thing so someone uploads 'image.png', you put that into the '/images/' directory, and also an put image.jpg into '/images/thumbs/' directory.

Granted, if there are tons of images being uploaded there will be a lot more complexity, sending to servers to send static content and what not, but for now, this should do...
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

theBiz

Silver Contributor
Speedway Pass
User Power
Value/Post Ratio
46%
Jul 9, 2009
1,162
535
NY
Hey thanx icy, it actually is pretty complex the site itself and there are thousands of users with tons of content about to be added so I'm tryin to donit right before I go ahead.
Also right now when files are uploaded they are changed to something random like 9939387463637.jpg

I want the picture names to be seo friendly... Is it possible to leave the files their exsisting name atleast and if a duplicate add a 1 to it or something? Thanx alot guys I really appreciate tue guidance and help.

Most importantly though is there some program or something to reformat bad formats? If someone uploads a .bmp how do I deal with such a large file? I do not want some ghetto thing where I say don't upload .bmps is there a way to just reformat file extensions automatically to .jpgs?
 

Icy

Contributor
User Power
Value/Post Ratio
11%
Feb 16, 2009
807
86
Hey thanx icy, it actually is pretty complex the site itself and there are thousands of users with tons of content about to be added so I'm tryin to donit right before I go ahead.
Also right now when files are uploaded they are changed to something random like 9939387463637.jpg

I want the picture names to be seo friendly... Is it possible to leave the files their exsisting name atleast and if a duplicate add a 1 to it or something? Thanx alot guys I really appreciate tue guidance and help.

Sure you can easily do something that'd increment the name if a file with the name already exists.

Does SEO, actually care much about image names too? I'm a programmer, and know very like about SEO, so I thought I'd throw this in here. :p

Edit: I ask, because trying to preserve names, and incrementing the file name really is a flat out waste of cpu time.. Unless there is a huge SEO gain.
 

mcjon77

New Contributor
User Power
Value/Post Ratio
31%
Sep 5, 2011
51
16
Thank you McJon for the response... Can you give me any details as far as the proper way to code this. I'm pretty sure I read somewhere the correct way was to have two folders one for the main pic and another for tue thumbnail.
You can actually do it a couple of different ways. Lets say that the original image was called pic1.jpg. Your script is going to make 2 versions of this file, one 100kb and 1 30kb (per your example in the earlier post. You could have 2 folders, one labeled full and one labeled thumb. Your script could then make a 100kb version of the original, which is also called pic1.jpg and put it in the full folder. It could then make a 30kb version called pic1.jpg and place that image in the thumb folder. the two new images have the same name but are in different folders.

The second way keeps both images in the same folder, but gives them different names. For instance the original pic1.jpg could be converted to a 100kb file called pic1full.jpg and a 30kb file called pic1thumb.jpg. Both files could be stored in a single folder.

I have scene both (as well as combinations and variations of the two) used. Personally, I prefer the "same file name, different folder" approach, as it is easier to work with. The key is to pick one method and be consistent with it throughout your website.

How will he create something to reformat all pics to .jpg then make a thumbnail of it?
Different programming languages have different libraries to handle image manipulation. Assuming that the application is being written in PHP, your programmer would most likely be using the GD library.

Also how does the platform makes sense of all of this? It must place the thumbnail in a different folder.. how does it keep track of which main picture in folder 1 should match up with the thumbnail version of itself in folder 2?
This is simple with the two folder method. The file names are the same, so your script assumes that any file in one folder has a complementary file of the same name in the other folder.
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

theBiz

Silver Contributor
Speedway Pass
User Power
Value/Post Ratio
46%
Jul 9, 2009
1,162
535
NY
Personally, I prefer the "same file name, different folder" approach, as it is easier to work with. The key is to pick one method and be consistent with it throughout your website.

i agree with this ^

This is simple with the two folder method. The file names are the same, so your script assumes that any file in one folder has a complementary file of the same name in the other folder.

this seems simple enough...
 

Post New Topic

Please SEARCH before posting.
Please select the BEST category.

Post new topic

Guest post submissions offered HERE.

Latest Posts

New Topics

Fastlane Insiders

View the forum AD FREE.
Private, unindexed content
Detailed process/execution threads
Ideas needing execution, more!

Join Fastlane Insiders.

Top