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 6162743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:42:21+00:00 2026-05-23T21:42:21+00:00

Given a JPG image, cut off it in horizontal direction so that the size

  • 0

Given a JPG image, cut off it in horizontal direction so that the size of spic is around 100K

Any tips?

  • 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-23T21:42:22+00:00Added an answer on May 23, 2026 at 9:42 pm

    Have used this function in the past works well for me…

    This will take an input file and create tiles of the specified size…

    function makeTiles($name, $imageFileName, $crop_width, $crop_height)
    {
        $dir = "source dir";
        $slicesDir = "target dir";
    
        // might be good to check if $slicesDir exists etc if not create it.
    
        $inputFile = $dir . $imageFileName;
    
        $img = new Imagick($inputFile);
        $imgHeight = $img->getImageHeight();
        $imgWidth = $img->getImageWidth();
    
            $cropWidthTimes = ceil($imgWidth/$crop_width);
        $cropHeightTimes = ceil($imgHeight/$crop_height);
        for($i = 0; $i < $cropWidthTimes; $i++)
        {
            for($j = 0; $j < $cropHeightTimes; $j++)
            {
                $img = new Imagick($inputFile);
                $x = ($i * $crop_width);
                $y = ($j * $crop_height);
                $img->cropImage($crop_width, $crop_height, $x, $y);
                $data = $img->getImageBlob();
                $newFileName = $slicesDir . $name . "_" . $x . "_" . $y . ".jpg";
                $result = file_put_contents ($newFileName, $data);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following HTML: <p>This is text and this is an image <img src=http://www.example.com/image.jpg
Given the following table id parentID name image 0 0 default.jpg 1 0 Jason
given the html structure: <div class=image-container> <img id=firstslide src=img/verybig.jpg> </div> I wonder if there
I would like to check if URL given by user is image (jpg, png,
Given the following code <div class=container> <p>Some Text</p> <p><img src=image.jpg><p> <p>More Text</p> </div> CSS
Everyone. I am using an image resizer script that resizes JPG images. It worked
Let's say that someone has a link to an external image: www.externalsite.com/img/photo.jpg Now, people
I have the HTML given below: <ul id=thumbsPhotos> <li src=/images/1alvaston-hall-relaxing-lg.jpg onclick=updatePhoto (this.title)><img src=/images/1alvaston-hall-relaxing-sl.jpg width=56
I was given one big JPG of the HTML interface. Now I need to
Given the path of a file (e.g. C:\MyPicture.jpg), how do I convert a binary

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.