Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:10:15+00:00 2026-05-23T04:10:15+00:00

I am working on a Codeigniter app that uses JCrop to crop the user’s

  • 0

I am working on a Codeigniter app that uses JCrop to crop the user’s profile image.

Once the image is uploaded, I am using a standard method to run Jcrop and submit coordinates via a form.

<script type="text/javascript">
    $(function() {
            $('#cropbox').Jcrop({
            onSelect: updateCoords,
            aspectRatio: 1,
            setSelect: [ 50, 50, 150, 150 ],
            bgColor: '#fff',
            bgOpacity: .2
        });
    });
    function updateCoords(c)
        {
            $('#x').val(c.x);
            $('#y').val(c.y);
            $('#w').val(c.w);
            $('#h').val(c.h);
        };
</script>

// some code here...

    <?php echo form_open('/profile/crop_picture', array('id' => 'crop_picture_form')); ?>

        <input type="hidden" name="x" id="x" />
        <input type="hidden" name="y" id="y" />
        <input type="hidden" name="w" id="w" />
        <input type="hidden" name="h" id="h" />
        <br />

    <?php echo form_close(); ?>

All this works perfectly on Safari and FF 4.0. The user selects an area for cropping, submits and the page refreshes with the cropped image.

On Chrome and IE8, when the user submits, the page refreshes but the image is not cropped. The kicker –> if one hits refresh in the browser, then the image is cropped.

Needless to say this is very weird. Does anyone have suggestions where to begin debugging this issue — or have you seen this happen/described before?

Thanks for helping.

EDIT: Still not resolved but further testing shows this may be a cache issue on Cr and IE8. Chrome seems to retain the original uploaded image and displays it even though the crop dimensions were submitted, processed, and saved by codeigniter on the server. At the end of my CI controller for cropping I put

redirect('/profile/picture', 'refresh');

which had no effect on Chrome and IE8 when the new page loads after the cropped image is submitted. The cropped image only shows if I manually trigger ‘refresh’ on the browser.

I have checked my server image files and it confirms this: although the cropped image was saved in my server, the image file (with same name) that is displayed on Chrome has the previous non-cropped dimensions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:10:16+00:00Added an answer on May 23, 2026 at 4:10 am

    This was resolved by changing my .htaccess which contained the following

    <IfModule mod_headers.c>
    # 45 MIN
    <FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
      Header set Cache-Control "max-age=2700"
    </FilesMatch>
    </IfModule>
    

    I removed jpg|jpeg and now things work as they should in Cr and IE8.

    Agreed, this should have been one of the first places to troubleshoot, but curiously FF and Saf don’t seem to obey this rule in quite the same way as Cr and IE8. On Saf and FF the newly minted cropped JPEGs — even having the same filename as the original JPEGs — are refreshed despite the .htaccess rule.

    If anyone has ideas on how to make this behavior consistent across browsers please post a comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I'm working on an app in CodeIgniter, and I want to have admin pages
I'm working on an app in CodeIgniter, and I'm trying to make a field
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
We're building a PHP app based on Good old codeigniter framework and have run
I’m working on a project and have developed the high level user requirements for
I've set up Subversion using Beanstalk + Coda for my web app, which up
I've just moved a site across to a production server, and a once working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.