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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:06:25+00:00 2026-06-02T20:06:25+00:00

I am modifying jpeg EXIF data. Some data requires to be defined as a

  • 0

I am modifying jpeg EXIF data. Some data requires to be defined as a fractions.
Here, I have two problems:
1.) Which is the correct fraction “format”? For instance when I have an exposure time (“ExposureTime”) of 30000µs and store it as 30000/1000000 the EXIF viewer shows the wrong exposure. Storing as “1/30” returns the correct result. Do all fractions have to be “1/x”?

2.) How can I calculate the fraction fast? The method I am using now (similar to “Dec2Frac” in [1]) is very slow.

Regards,

[1] Calculating EXIF exposure time as a fraction (Delphi)

  • 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-06-02T20:06:32+00:00Added an answer on June 2, 2026 at 8:06 pm

    This is the code I have used in C# for calculating a fraction for EXIF GPS data. The method returns an array of two integers – one being the numerator and one the denominator.

    public static int[] GetFraction(Decimal value)
            {
                int denominator = 1;
                int numeratorMultiplier = 1;
                Decimal numerator = value * numeratorMultiplier;
                int failSafe = 0;
    
                while (Decimal.Remainder(numerator, 1m) != 0m && failSafe < 20 && ((long)numerator * 10) < Int32.MaxValue)
                {
                    denominator *= 10;
                    numeratorMultiplier *= 10;
    
                    numerator = value * numeratorMultiplier;
                    failSafe++;
                }
    
                return new int[] {Decimal.ToInt32(numerator), denominator};
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am modifying my PHP network's code to have user roles like wordpress here
I'm modifying Qemu's source code, created a file like this #if defined(TARGET_I386) /* some
I am modifying a Nant build script to run some unit tests. I have
I have two threads modifying the same object, lets say MyObject, and so have
I have two threads modifying the same objects. The objects are custom, non-synchronized objects
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I'm working on modifying some existing code for a payment gateway and I'm not
I am modifying an existing HQL query which returns individual columns rather than an
I need some help modifying the Webform Module so that it can work for
I'm modifying some code that calls enumerate on a list declared via a list

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.