I know the image size for the PC in Four Wonder not upload from is drawn from four Wonder I find the sizing. Fit already been done by This อ่ะ ครับ.

$ S = GetimageSize ($ pro);
$ W = (int) $ s [0];
$ H = (int) $ s [1];
$ Ss = round (($ w * $ h) / 1024);


$ Ss not show it was in the Four Wonder. I know very .

Thank you for answers.

Dani AI

Generated

— the confusion comes from mixing pixel dimensions with file size. Width and height are counts of pixels; multiplying them does not produce the on-disk size. Compression, file format (JPEG/PNG), color depth and metadata determine the actual bytes.

If the image file already lives on the server, is correct: use server functions to read the file size or the pixel dimensions. See the PHP docs for how these functions report values: PHP getimagesize and PHP filesize.

If the goal is to let a user pick a file from their computer and show its size and dimensions without uploading, do that in the browser with the HTML5 File API. The selected File exposes a size property (bytes), and a FileReader can produce a data URL that an Image object can load so you can read naturalWidth and naturalHeight. Example workflow:

  • user picks file with <input type="file">
  • read file.size to get bytes
  • use FileReader.readAsDataURL(file) and create an Image() to get pixel dimensions

Example client-side snippet:

const input = document.querySelector('input[type="file"]');
input.addEventListener('change', e => {
  const f = e.target.files[0];
  if (!f) return;
  const kb = (f.size / 1024).toFixed(2);
  const reader = new FileReader();
  reader.onload = ev => {
    const img = new Image();
    img.onload = () => {
      console.log('KB:', kb, 'W:', img.naturalWidth, 'H:', img.naturalHeight);
    };
    img.src = ev.target.result;
  };
  reader.readAsDataURL(f);
});

Notes: browsers won’t reveal full local paths for security. For compatibility and details see MDN on the File API and FileReader (for example, File.size and FileReader).

Recommended Answers

All 4 Replies

I have no idea what you are talking about.

I want comment.

$S = GetimageSize ($ pro);
$W = (int) $ s [0];
$H = (int) $ s [1];
$ss = round (($ w * $ h) / 1024);

I want Find size images in computer.
by not upload from form.
I select in folder.
size show in web with size in folder Unequal.

so you want the image filesize?

$size = filesize($pro);
$size = $size / 1024; // put in Kb

Is this helpful?
It is really hard to understand

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.