Pls help me to set up a adaptive image :( im trying to make a page that can view in all mediasizes. :((
im trying to setup http://adaptive-images.com/details.htm but it doesn't work for me.
can someone help me to this?
Pls help me to set up a adaptive image :( im trying to make a page that can view in all mediasizes. :((
im trying to setup http://adaptive-images.com/details.htm but it doesn't work for me.
can someone help me to this?
Short checklist tied to what described and asked: Adaptive-Images is a small PHP solution that needs PHP + the GD image library, an .htaccess that the server actually reads, and a writable cache folder. On localhost those three are the most common blockers (GD missing, .htaccess ignored, ai-cache not writable). (github.com)
Quick tests you can run right now. Put this file in your htdocs and open it in the browser to verify GD is available:
<?php
if (function_exists('gd_info')) {
var_dump(gd_info());
} else {
echo "GD not installed";
}
?> If GD is missing: on Windows/XAMPP edit php.ini and enable the gd extension (uncomment or add extension=gd / extension=php_gd.dll), then restart Apache. On Debian/Ubuntu install the package (e.g. sudo apt install php-gd) and restart Apache/PHP-FPM. (php.net)
Make sure Apache is actually processing your .htaccess rules: enable mod_rewrite and allow per-directory overrides (often sudo a2enmod rewrite and set AllowOverride All for your site), then restart Apache. Check the server error log if the rewrite rule causes a 500. If .htaccess is ignored the adaptive script never runs. (httpd.apache.org)
Folder and cookie notes: create the cache folder and give the webserver ownership (adjust user for your distro; common examples shown):
mkdir -p /path/to/ai-cache
sudo chown -R www-data:www-data /path/to/ai-cache
sudo chmod -R 755 /path/to/ai-cache Also ensure the tiny JS that sets the resolution cookie is placed inline high in <head> (race conditions can cause the browser to request images before the cookie exists). Finally: if this is a new project, prefer native srcset/picture for responsive images — they’re simpler and better supported long-term. Example and docs: (developer.mozilla.org)
If these checks still show no activity, paste the output from the GD test and the exact .htaccess you used so the next steps can focus on specific errors.
Jump to Post— pritaeas 2,276it doesn't work for me.
Doesn't work is too vague. What have you done, what did you expect, and what isn't working? Do you have an example?
it doesn't work for me.
Doesn't work is too vague. What have you done, what did you expect, and what isn't working? Do you have an example?
i just follow the instruction attached but its not work for me.
i copy and paste adaptive-images.php and .htaccess to my localhost, and add script code to the head part of my web and done, nothing happen to my image.
what do u thing sir?
Do you have the GD extension? Does the cache folder exist? Is it set with write permissions?
no sir, i dont have that GD. can i need to do? :(
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.