We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Resized Image Quality

Development and Programming

PXLated's avatar
PXLated
1,800 posts
16 years ago
PXLated's avatar PXLated

Nope, if you check the screen grab earlier in this thread, it’s a jpg. No conversion, it takes what you give it.

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4

I found the solution in the “file” thread!

this is essential if you want to use file 3.1.1 extension from marc huot:

round line #1030 under the heading “Write File”

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) {}

This will take care of your problem and save your jpeg as a true jpeg. The default image size is set to 60% quality (this is medium in Photoshop)… if you want it set to a higher quality add the number below. (90 means 90% image quality)

if(@imagejpeg($dst_img, $dst, 90) !== false) {}

this is the original thread: http://ellislab.com/forums/viewthread/38997/P360/#335581

thanks for helping out! my feeling was right. it created “.gif”s and just added “.jpg”… but then I would have NEVER EVER found a solution 😉 excellent forum. I love it!

cheers stefan

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
Nope, if you check the screen grab earlier in this thread, it’s a jpg. No conversion, it takes what you give it.

in this case it got a .gif camouflaged as a .jpg and it converted it to gif… at least somebody does it’s job right 😉

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

Ah- the extension was the culprit. Note- this shouldn’t affect files uploaded/resized via the stock install, so I’m going to shift the thread to the extensions forum and leave it open- just in case someone else runs into the same problem.

       
outline4's avatar
outline4
271 posts
16 years ago
outline4's avatar outline4
Ah- the extension was the culprit. Note- this shouldn’t affect files uploaded/resized via the stock install, so I’m going to shift the thread to the extensions forum and leave it open- just in case someone else runs into the same problem.

yes, seems like a good idea. I really wasn’t shure where to begin! thanks for your patience

stefan

       
Luke Hardiman's avatar
Luke Hardiman
109 posts
16 years ago
Luke Hardiman's avatar Luke Hardiman

Thanks, I am having this exact problem with Mark’s File extension.. I’m uploading jpgs, which are getting thumbnails created with the extension .jpg, but which are actually .gifs.

At least I know exactly how to fix this now.

       
Andy Slipher's avatar
Andy Slipher
79 posts
16 years ago
Andy Slipher's avatar Andy Slipher

Same issue here, but I can’t seem to find the lines to edit referenced in this thread. Are we still talking about the core.image_library.php file? Around line 1030? I did a search in that file code and can’t seem to find it. Help?

       
Andy Slipher's avatar
Andy Slipher
79 posts
16 years ago
Andy Slipher's avatar Andy Slipher

Nevermind. I found it and fixed (this always happens after I post :|).

It’s in the extension file - line 1028. The file path: extensions/ext.mh_file_ext.php

Before the fix that’s exactly what it was doing - creating a .gif and giving it a .jpg extension.

       
bkuberek's avatar
bkuberek
124 posts
16 years ago
bkuberek's avatar bkuberek
It’s in the extension file - line 1028. The file path: extensions/ext.mh_file_ext.php

Yes. lets keep in mind it is the line 1028 on 3.1.1 version of Mark Huots’ file extension.

       
kscot's avatar
kscot
91 posts
16 years ago
kscot's avatar kscot

Glad I found this thread. I was running into the same problem with images looking really bad when uploaded using the files extension. Thanks for posting the solution.

       
PhilBrienesse's avatar
PhilBrienesse
185 posts
16 years ago
PhilBrienesse's avatar PhilBrienesse

Super helpful thanks so much. I was about to switch to phpthumb when i came across this post. I assumed it was an EE issue not the extension. For anyone else reading this who may not be php savy in the example code to replace

(@imagejpeg($dst_img, $dst) !== false) {}

you still need an if at the start of that line. Like this..

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

Just in case you missed it.

       
bkuberek's avatar
bkuberek
124 posts
16 years ago
bkuberek's avatar bkuberek
I was about to switch to phpthumb when i came across this post.

I use both. I gave up on relying on it to resize for me. So I set it up so images are uploaded as is and I setup phpThumb withing my images folder with its own .htaccess so I can write my images nicely like this:

/images/thumbs/f=jpeg;q=75;100x200;{image}
       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.