Drupal.. images compression issue - drupal

for some reasons the images I upload to my Drupal website are downsampled.
For example the image I'm uploading is 857x947
I've checked the following settings:
- the size of the CCK ImageField: 420x840
- the size of image cache used to re-sample the image: 420x840
Image Toolkit: Compression: 100%
I'm using cropping functionality. But I'm not dragging a small area, just almost all the original image is selected.
What am I missing ? Maybe php is compressing the image while uploading it ?
Thanks

Just to be sure that it is not caching try to clear all Drupal caches and your browser cache as well.
Then check if the imagecache preset you're using really isn't containing any scale action, just a crop action. To be sure, again just flush the imagecache preset and check the folder that there is no old, wrong image left.
Then go to your content type -> Manage Fields -> your picture field and check if the maximum resolution in there is set correctly.
I'm not aware of any other steps that downsample an image, if you don't have any other image-related modules installed. You wrote that you checked theses things, but most likely one of those steps is responsible.

By default Drupal resamples uploaded jpgs to 75% of their original quality.
Change it in this configuration page
/admin/settings/image-toolkit
Also I noticed that Image Magick library gives better results than default GD, but depends of the format of the image, etc.

Even if you do not use any imagestyle effect and whatever the setting at /admin/settings/image-toolkit the image will always be altered, see https://drupal.stackexchange.com/questions/246398/image-derivative-size-different-from-original-even-in-absence-of-any-effect and the related Drupal 7 core issue https://www.drupal.org/node/2914964

Related

Wordpress Is Changing My Image File Names and Adding Numbers (150x150 for example)

I am using Wordpress and the Elementor theme. When I upload images via the Image Box tool, the image shows for a few days, then at some point down the road, the image file names changes on the server and the image is then broken on the site.
On the server, I can see the original image, and then some sort of image size numbers are added to the file name such as 150x150 or 1026x768).
I understand that Wordpress sometimes resizes and adds images, but I have gone into images and entered "0" in setting to prevent it from doing this. I have also gone into functions.php to remove any re-sizing issues, but there was no code related to resizing there.
That's not Wordpress doing it, it's your theme..
Well it turned out to be a server load issue. The shared server couldn't handle the requests we were making daily, which affected our image uploads. If anyone else has this issue, upgrade to a dedicated server.

Refresh original image data

I am about to upload a large number of images to a Wordpress site.
I'll need to resize and replace them until the size is deemed to be the best one. I plan to make the first upload by FTP and then a plugin like Media From FTP.
Sequential uploads will be also be done by FTP. The problem is that this will not update the original image data in the database (for example the dimensions which will be different).
I've seen the plugin Enable Media Replace regenerating original image information, but only for a specific image while I want to do this in batch. I've seen thumbnail regeneration plugins but I'm uncertain that they update the original image's data so I don't know if there's a way.
Any suggestions?
Thanks!
To answer my own question, here's what I did :
Downloaded my images by FTP
Made my resize operations and re-uploaded my images using FTP
Installed WPR Rebuild Meta Data plugin to rebuild all the modified image meta data
Installed Force Regenerate Thumbnails plugin to regenerate thumbnails.
I give a more thorough description here.

TimThumb - Broken Images on WordPress Site, but Only on One Dimension

I'm having some problems on a WordPress site I am working on: http://bit.ly/1Hs41z8
TimThumb generates the thumbnails in the bottom section of the site just fine with no issues. However, in the slider, the thumbnail images are broken. When I look at the URL, it looks really long and complex so I am not sure what is causing it to break. If I go to the image url itself, the image loads fine.
Any help would be greatly appreciated!
TimThumb is no longer supported or maintained. You can read the reasons why on blog: TimThumb End of Life.
See what Google say's
I would suggest you to use PHPThumb.
From PHPThumb:
phpThumb() uses the GD library to create thumbnails from images (JPEG,
PNG, GIF, BMP, etc) on the fly. The output size is configurable (can
be larger or smaller than the source), and the source may be the
entire image or only a portion of the original image. True color and
resampling is used if GD v2.0+ is available, otherwise paletted-color
and nearest-neighbour resizing is used. ImageMagick is used wherever
possible for speed. Basic functionality is available even if GD
functions are not installed (as long as ImageMagick is installed). One
demo file uses portions of Javascript API by James Austin.

Image not loading in wordpress add media

Has anyone face this problem ? My images are not loading whenever i try to add an image from Add media button/ featured image option in wordpress. It shows an error like this:
An error occurred in the upload. Please try again later.
Please help if anyone knows the solution.
A lot of factors could be causing this issue.
First - is this a new issue? Have you upgraded/changed anything recently and this began happening?
Second - what are the image sizes? Are they large? Not only in file size but dimensions? Sometimes large images can cause an upload error. Scale them down, both in file size and possibly image size, and see if that helps.
Third - disable your plugins one by one and check the upload again between each plugin. If it's still not uploading when all plug-ins are disabled then activate the default WordPress theme. If it's still not uploading then it may require uninstalling/reinstalling wordpress or even a larger issue that may be out of standard troubleshooting range & would require a more detailed look.

Most effective way to import large images?

I am interested in adding a landsacpe footer on my website but the image size is 115KB and will load on every page... Is there any effective way to load an huge image such as this one:
http://gyazo.com/5b1b7312ec4370873368df0181e41b13.png
Here's a few things that may help you:
EDIT: I tried the second tip in the list below (tinypng.com) and it reduced the size of your image with 71% to 39.1 KB. So that's a big win.
Make sure to set the cache headers on your webserver so that the browser can cache the file. Also use the same URL for all other times you use the image. Doing these two simple things will make sure that the image will only get downloaded the first time the browser requests it. All other times it will be loaded from the browser's cache.
Make sure to check if the image is as small as it can be. If you use a PNG then use tools like https://tinypng.com/ to squash all metadata out of the image. If you use a JPEG then maybe lower its quality. If you use Photoshop make sure to "save the image for web". This will also reduce the size. For photographs you are mostly better of using JPEGs, for text or other images that need to be lossless use PNG or GIF.
Loading images will not really slow down your page that much. Not like JavaScript anyway. Loading Javascript will block the rendering of the page until the JS file is downloaded unless you use special loading techniques. That is not the case for images: the page will continue being rendered and the user can start using the page.
If the image is placed using an IMG tag the make sure to set the width and the height of the image in the CSS (or using the img width and height attributes). That will make sure that the browser does not need to reflow the page when the image is downloaded. It will know what size it needs to be even before the image is downloaded.
There is a maximum number of parallel requests per domain that the browser will do. If the image has a very low priority you could postpone its loading and wait for the onLoad event. This will make sure the other resources (with a a higher prio) will be downloaded first. This will require some JavaScript, but not that much (Use an image lazy loader, there are many).
As I said in the previous item the are a maximum number of requests PER DOMAIN. This is why you could also create a new (sub)domain and load some content from there. It will increase the total number of resources that will be downloaded in parallel. using a CDN will also help here because they also have a separate domain (and they are optimised as well).
If you want to read some REALLY GOOD books about this kind of optimising, read these:
http://www.amazon.com/High-Performance-Web-Sites-Essential/dp/0596529309
http://www.amazon.com/Even-Faster-Web-Sites-Performance/dp/0596522304

Resources