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

  • SEARCH
  • Home
  • 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

I've been working on a web app using the CodeIgniter framework and I am
I have a site that uses wordpress for the frontend & a Codeigniter app
I'm working on an app in CodeIgniter, and I'm trying to make a field
I'm working on an app in CodeIgniter, and I want to have admin pages
I have a codeigniter code that is working on local Apache installation. But it
I am working on a codeigniter site, the client has requested that the price
my facebook app developed in CodeIgniter, hosted on hostgator, was working fine before i
I'm working with CodeIgniter to set up some user login functions to my site
I am working in codeigniter project I want to rewrite my URL using htaccess.
I'm developing with Codeigniter and working on password reset using a similar model to

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.